randy3k / Terminus

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

Default Terminus key bindings are overridden by default Sublime Text key bindings #427

Open cow1337killer3 opened 1 month ago

cow1337killer3 commented 1 month ago

Using Windows 11, Sublime Text 4, PowerShell 7.

Default Terminus key bindings:

    { "keys": ["backspace"], "command": "terminus_keypress", "args": {"key": "backspace"}, "context": [{"key": "terminus_view"}] },
    { "keys": ["ctrl+u"], "command": "terminus_keypress", "args": {"key": "u", "ctrl": true}, "context": [{"key": "terminus_view"}] },

Default Sublime Text key bindings:

    { "keys": ["backspace"], "command": "left_delete" },
    { "keys": ["ctrl+u"], "command": "soft_undo" },

Run toggle_terminus_panel, type something into PowerShell, then press the backspace key. Sublime Text console log:

key evt: backspace 
command: left_delete // Backspace from Sublime Text
command: soft_undo // Ctrl+U from Sublime Text
key evt: backspace
command: left_delete
command: soft_undo

Results in Terminus deleting a character and undoing it over and over.

Was able to fix it by reassigning backspace to Ctrl+H:

    {"keys": ["backspace"], "command": "terminus_keypress", "args": {"key": "h", "ctrl": true}, "context": [{"key": "terminus_view"}]},
cow1337killer3 commented 1 month ago

Also found: Ctrl+C works correctly with selected text, but with no selection it types the letter "c" instead of "^C". Doesn't log any Sublime commands. Ctrl+Z performs 'undo' (not listened as an exception for natural keyboard). Doesn't log any Sublime commands.

I have "natural_keyboard": true.