Closed ghost closed 5 years ago
This sounds like the issue described at http://invisible-island.net/xterm/xterm.faq.html#xterm_arrows which says how some applications do the equivalent of tput smkx
and change the keyboard mode.
You may be able to do tput smkx;dtach -a socket;tput rmkx
and have the cursor keys work again.
rtorrent is also possibly sending an escape sequence on startup to make the cursor invisible.
That fixed it! Looks like I can also run tput civis
to hide the cursor. Thanks for the help.
I've been trying to set up a dtach session for rtorrent.
dtach -n socket rtorrent; dtach -a socket
works perfectly, but wierdly enough, when there's more than 1 second between the first command and the second, the up, down, right and left arrows are remapped to A, B, C and D respectively, and the terminal cursor is actually visible in the bottom left corner of rtorrent (it's normally invisible).This means that
dtach -n socket rtorrent; sleep 1; dtach -a socket
isn't buggy, butdtach -n socket rtorrent; sleep 2; dtach -a socket
is.Every other program that I tried didn't get the bug, except vim, which would exit insert mode and throw an "E388: Couldn't find definition" error when any arrow key was pressed, but I'm not sure which key press that would be. I also tried xev, but the arrow key codes looked normal there.
I'm using st with $TERM set to xterm-256color. Also tried urxvt and xterm, and setting TERM to screen-256color. According to vim, $TERM doesn't change inside the dtach session though.
dtach version 0.9 (pacman version) on an up-to-date Arch Linux install.