Sublime Forum

Finally, a multi-platform Terminal running in Sublime Text

#42

OK, worked out the problem, it was a modified exec.py. Now it works great, thanks for creating it!

A question though: is pasting text into the terminal supposed to work?

0 Likes

#43

How about “Sublimely Terminal.”

0 Likes

#44

Yes, pasting should work out of the box.

0 Likes

#45

How can I debug this? Paste doesn’t work for me. It’s probably easier than you trying to recreate it.

0 Likes

#46

Are you using the latest version? Try upgrading via package control.

0 Likes

#47

Did upgrade, but no help. Paste didn’t work for me out of the box. It’s probably my setup again, but no idea how, everything should be pretty much vanilla now.

Maybe I can turn on the logging if you can tell me how and it’ll help. Nothing comes up on the console when it fails.

Edit: Of course that does help becuase it shows the wrong command is being executed! Problem solved below…

0 Likes

#48

Try to turn on sublime.log_commands(True) and check which command is being triggered.

0 Likes

#49

The more I think about it, the more I like it; Sublimely Terminal (SubTerminal) may be a good choice.

0 Likes

#50

It is now renamed as SublimelyTerminal. Most of the commands are renamed from console_ prefix to sly_term_ prefix.

0 Likes

#51

Slightly off the topic but important!

I like keeping the highlighting trailing spaces activated for my workflow.
I disabled the trailing whitespaces in terminal tab view:

But cant figure out how can I disable the same in the panel view. Currently the panel looks like:

So if anybody can help with this issue, it will be great!

By the way the plugin is awesome!

0 Likes

#52

Minor typo in the repo readme at the very bottom: “SublimelyTemrinal” -> “SublimelyTerminal”

For small things like this, is this the right place to mention them or is it better to start opening github issues?

0 Likes

#53

That doesn’t help, it just shows “command: paste.” Don’t you have your own logging in the plugin? I figured that from one of the screen animations you posted.

Even if I drag a selection into the terminal window to do the paste it doesn’t work. The dragged text disappears from its source suggesting that ST thinks the paste was successful.

0 Likes

#54

If I paste via the context menu in the panel it just prints undo paste. The plugin setting “debug” is true.

0 Likes

#55

But your paste works?

0 Likes

#56

Oh right, no paste is not working (Win 10). Copy does work nicely.

0 Likes

#57

Thank gawd, I thought it was just me again. Is there anything notable about your ST setup? I wonder if a global setting is affecting it.

0 Likes

#58

OK the pasting might be a tricky issue.

I have these User keybindings:

    { "keys": ["ctrl+shift+v"], "command": "paste_from_history" },
    { "keys": ["ctrl+v"], "command": "paste_and_indent" },
    { "keys": ["ctrl+shift+v"], "command": "paste" },
    { "keys": ["ctrl+alt+v"], "command": "paste_from_history" },

So my ctrl+v overrides the plugins keybinding:

Default (Windows).sublime-keymap:12:    { "keys": ["ctrl+v"], "command": "sly_term_paste",`

So the right command to execute is sly_term_paste (which does work) and we can do that with adding a second keybinding with a context that checks for the terminal. I don’t know if it is at all possible to override the normal paste action in the terminal (which would be what happens if you drag or right-click-paste).

0 Likes

#59

Actually, I just copy the plugins binding into my user file and it takes effect again.

    { "keys": ["ctrl+shift+v"], "command": "paste_from_history" },
    { "keys": ["ctrl+v"], "command": "paste_and_indent" },
    { "keys": ["ctrl+shift+v"], "command": "paste" },
    { "keys": ["ctrl+alt+v"], "command": "paste_from_history" },
    { "keys": ["ctrl+v"], "command": "sly_term_paste",
        "context":
        [
            { "key": "setting.sly_term_view" },
            { "key": "setting.sly_term_view.nature_clipboard" }
        ]
    },

Now paste works with ctrl+v at least.

0 Likes

#60

Yep, that’s the problem for me as is the fix. Looks like I’ve copied the key map file wholesale then changed what I wanted and that is not the right way to do it.

As noted above it still needs an override on the Edit and context menu paste commands though.

0 Likes

#61

There is only one thing missing from this tool to allow it to fully replace the built-in build system, making that functionality interactive, is the file_regex function from there. Even if the double-click to jump to the error line is too hard to implement, the error phantoms and next/prev error navigation would be super useful.

Although most people might not see the benefit of interactively building via a terminal, I also use the error functionality for debug logging. So when I log something from my code it outputs the file name and source line as well and the log messages appear right in the code, which is a huge productivity boost.

You should be able to take the code pretty much verbatim from exec.py in Default, but one thing I would request if you did this is an option to display message phantoms alongside the line instead of underneath. This reduces clutter substantially. It’s a simple two-line change which I can give you.

Another argument for replacing the built-in build system, besides interactivity, is persistence and complex build environments.

Some people may want to launch build commands in a different CLI environment. For instance I could ssh into a remote server in the shell, log in once and then launch build commands as required. This is what I do when I’m building cross platform code, but I have to fiddle with slow and finicky tools that pass commands to the remote servers and capture the output.

In another scenario, there may be a lot of setup required in the environment before the build commands are executed and the setting up and tearing down of that could be avoided.

1 Like