randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.39k stars 81 forks source link

Ctrl+C Does Not Do Anything in Terminus cmd.exe [Windows] #320

Open amaiable opened 3 years ago

amaiable commented 3 years ago

Typically when using the command Ctrl+C in cmd.exe, what will happen is something like this: imageAfter typing a line and pressing Ctrl+C, the line will not be executed and a new line will start.

However, when I use Terminus' cmd.exe, pressing Ctrl+C doesn't do anything. image

This isn't the problem with other shells, for example Git Bash, where pressing Ctrl+C does this: image

I've tested this on another computer as well and it seems Ctrl+C doesn't work there either.

randy3k commented 2 years ago

It is a winpty bug and the author of it doesn't care about it. One possible solution for us is to move the plugin to python 3.8 and use the new version of pywinpty which relies on the new ConPTY API. Unfortunately, we have to waiting until a new version of Package Control is released in order to have the dependency feature in Python 3.8.

Mark-Joy commented 2 years ago

I just saw they add .python-version file which is 3.8 in Package Control Are we good to go now?

randy3k commented 7 months ago

I just saw they add .python-version file which is 3.8 in Package Control Are we good to go now?

python 3.8 is fully supported now. It will be great if someone can test out the current master branch. Will make a release once it is confirmed to work.

zchrissirhcz commented 5 months ago

I just saw they add .python-version file which is 3.8 in Package Control Are we good to go now?

python 3.8 is fully supported now. It will be great if someone can test out the current master branch. Will make a release once it is confirmed to work.

Hi, @randy3k , do you mean Terminus's master branch already support Ctrl+C short key for kill a running program? If so, would you mind telling me how to use it? I don't know how to install a ST plugin without the package control.

zchrissirhcz commented 5 months ago

OK, I figured out how to install Terminus master branch:

My machine is macOS, and Ctrl+C can stop a running a program in terminus opened terminal, for both v0.3.30 and master.

I figured out my previous configuration contains an item of Ctrl+C, removing it then Ctr+C works in the terminal:

{ "keys": ["ctrl+c"], "command": "copy" },

Actually I use Windows more often and I just configure many short keys:

[
    { "keys": ["ctrl+j"], "command": "toggle_terminus_panel" },
    { "keys": ["ctrl+s"], "command": "save", "args": { "async": true } },
    { "keys": ["ctrl+x"], "command": "cut" },
    { "keys": ["ctrl+c"], "command": "copy" },
    { "keys": ["ctrl+v"], "command": "paste" },
    { "keys": ["ctrl+z"], "command": "undo" },
    { "keys": ["ctrl+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },
    { "keys": ["ctrl+a"], "command": "select_all" },
    { "keys": ["ctrl+shift+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
    { "keys": ["ctrl+forward_slash"], "command": "toggle_comment", "args": { "block": false } },
    { "keys": ["ctrl+break"], "command": "cancel_build" },
]

Removing Ctrl+C works for the terminal, but the editor code region now lacks Ctrl+C. So here comes my new question: How can I separately configure Ctrl+C key for both editor region and Terminus's terminal?