zyedidia / micro

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

Several keybindings don't work over SSH+Byobu (Shift+arrows, Ctrl+arrows) #1890

Open csolisr opened 3 years ago

csolisr commented 3 years ago

Description of the problem or steps to reproduce

When using SSH on a server configured to run Byobu, attempting to use Ctrl or Shift plus the arrow keys outputs a keystroke sequence instead of performing the bound movements.

Specifications

Commit hash: "Version: 2.0.6" from Buster Backports OS: Debian Buster (host), Windows 10 and Arch Linux (guest) Terminal: SSH + Bash + Byobu (host), Tilix (Arch linux guest), OpenSSH and WSL2 (Windows guest)

csolisr commented 3 years ago

Update, I just manually upgraded to version 2.0.8 and it presents the same problem.

Version: 2.0.8 Commit hash: cfcb2e45 Compiled on October 06, 2020

zyedidia commented 3 years ago

What is the value of the TERM environment variable?

csolisr commented 3 years ago

On the host: screen-256color On the guest: xterm-256color (Arch Linux), N/A (Windows)

zyedidia commented 3 years ago

I think the use of screen-256color is causing the issue. If you are using tmux, consider using tmux-256color instead. Alternatively, you could just run micro with the xterm option set to true.

csolisr commented 3 years ago

I managed to make Byobu work properly by forcing the xterm mode, adding the following line to ~/.byobu/profile.tmux:

set -g default-terminal "xterm-256color"