zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
25.15k stars 1.17k forks source link

Weird codes from alt + command + arrow key #1804

Open dullbananas opened 4 years ago

dullbananas commented 4 years ago

When I press alt + command + up key, this gets typed:

[1;11A

Similar codes appear with other arrow keys.

Terminal: pythonanywhere console

Micro commit hash: c51f849

AndydeCleyre commented 4 years ago

Yes, some of my shortcuts no longer work in 2.0.7, including alt+<cursor-key> and ctrl+shift+<cursor-key>, though they work fine in 2.0.6.

zyedidia commented 4 years ago

What terminal are you using?

AndydeCleyre commented 4 years ago

Konsole, here.

AndydeCleyre commented 4 years ago

Oh, I'm seeing now this is only a problem while I'm in a tmux session. @dullbananas is that the case for you? If not, I'll remove the below and find/open a separate issue.


The key events received are quite different, for, e.g. alt-left:

without tmux:

EventKey: Alt-Left: "\x1b[1;3D"

with tmux:

EventKey: Alt-[: "\x1b["
EventKey: 1: "1"
EventKey: ;: ";"
EventKey: 3: "3"
EventKey: D: "D"

While in the static 2.0.6 release they are identical, and in the first form.

tmux 3.1_b konsole 20.08.1 micro 2.0.7

zyedidia commented 4 years ago

Yes I think this has been fixed on the master branch (let me know if it doesn’t work if possible). I might push out another release next week with those fixes and some more improvements, and in the meantime you can use the nightly.

It might also work on 2.0.7 if you set your TERM variable to tmux-256color or if you set the xterm option to true.

dullbananas commented 4 years ago

Oh, I'm seeing now this is only a problem while I'm in a tmux session. @dullbananas is that the case for you? If not, I'll remove the below and find/open a separate issue.

@AndydeCleyre I have never used tmux before

dullbananas commented 4 years ago

Oh, I'm seeing now this is only a problem while I'm in a tmux session. @dullbananas is that the case for you? If not, I'll remove the below and find/open a separate issue.

@AndydeCleyre I have never used tmux before

AndydeCleyre commented 4 years ago

Confirmed:

@dullbananas, what about you?