micro icon indicating copy to clipboard operation
micro copied to clipboard

Shift key doesn't work in Micro running in a terminal session with Tmux

Open danddinh opened this issue 1 year ago • 2 comments

Description of the problem or steps to reproduce

Steps

  • Launch Tmux session to a folder, eg. tmux new -s foo -c /etc
  • Open micro: micro
  • Type some text in a line
  • Move caret to middle of the line
  • Press Shift+Left to select some text to the left
  • Error: Text is not selected, instead, it shows [1;2D

The same thing to Shift+Right, it shows [1;2C.

But it seems advanced input all not working in Tmux, mouse click becomes [<0;34;23m

Specifications

Latest micro, in WSL Bash

Commit hash: -- OS: Windows 11 Terminal: Windows Terminal Bash

danddinh avatar Feb 23 '24 07:02 danddinh

The same problem here :(

robinpecha avatar Jul 08 '24 11:07 robinpecha

I have not used tmux much before and I do not know much about terminals but there was this section in a page: https://github.com/tmux/tmux/wiki/Modifier-Keys#tmux-is-recognizing-the-key

I was testing using xterm and tmux 3.1c but TERM was set as screen by default so keys pressed together with modifier keys were being written in micro. The keys were being handled and not written in micro when TERM was set to tmux-256color. I tried testing using tmux 3.3a too but TERM was set as tmux-256color by default.

niten94 avatar Jul 08 '24 15:07 niten94

Maybe it helps someone, I got this issue too, tried everything, nothing worked. Then I remembered that few days ago I suddenly by mistake deleted my .bashrc and had to quickly create a new one from scratch. So this must be what cause the problem I thought and found the vanilla .bashrc that comes with ubuntu and sourced it in to my .bashrc and it solved the problem. I know I'd better go over each file in this vanilla .bashrc and see what line solves the problem but I am at work and have work to do.

exebook avatar Dec 25 '24 02:12 exebook