Arrow keys are not working with terminal server telnet (termnetd) session. My cursor keys do not work (ncurses FAQ) Why can't I use the cursor keys in (whatever) shell? Backspace, del, arrow keys not working with interactive programs in Tilda. Search history from multiple bash session only when Ctrl + R is used, not when arrow keys.
I looked and couldn't find a answer for this anywhere. I'meters using PuTTY from Windows to link to various web servers where I run bash and display screen. It seems bash works fine with ctrl-arrow keys to jump word-to-word on the control line but within screen it's not working. Not in display, ctrl-left transmits '^OC and ctrl-right is '^OD'. Within display screen I instead get '^Chemical' and '^G', which shows up to become the requirements for just the remaining/right arrow keys. Can be there any way to obtain screen to recognize ctrl-arrow keys when making use of PuTTY? (FYI, I don't keep in mind having this issue when using gnu-terminal in linux instead of PuTTY).
Upgrade: It appears PuTTY is definitely the issue as it can be not sending the escape codes that are necessary for this to function. I'michael offering up for now and using Cygwin+mintty.
kbosak
kbosakkbosak27211 money logo55 sterling silver badges1010 bronze badges
8 Answers
Edit:
Right here's what worked well for me:
- My
/.bashrc
piecesTERM=xterm
(mine occurs to becomeTERM=xterm-256colors
) overriding display screen'sTERM=screen
- I establishedPuTTY gt; Terminal gt; Functions gt; Disable Application cursor keys settingtoexamined
- I get into
tput smkx
at the Bash prompt - Right now Ctrl-Arrow keys jump word-by-word
- For educational reasons, if I do:
tput smkx hexdump -c
I obtain0000000 033 ? 1 l 033 =
andtput rmkx hexdump -d
gives me0000000 033 ? 1 l 033 gt;
I think there'h a way to remodel this into something a little much better, but it's what I've obtained so far and it seems to work.
Unique answer:
From
information display
:Each window in a 'screen' session emulates a VT100 airport, with some additional functions added. The VT100 emulator will be hard-coded, no some other terminal forms can end up being emulated.
And VT100s don't possess Ctrl-Arrow keycodes.
Dennis WilliamsonDennis Williamson51.5k1111 yellow metal badges9393 silver precious metal badges132132 bronze badges
As described in right here, u can put in /.inputrc:
It worked for me.
Neighborhood♦
Fayer MetersFayer Jordan
I'michael somewhat amazed that you got Putty to send out ctrl-arrowkeys properly actually without using screen, as that offers never worked well for me. My remedy has been to change to making use of alt-arrowkeys (meta-arrowkeys), which I think have the same forward-word / backward-word binding in bash by default, though I got to issue a few extra instructions for zsh to recognize them:
ZedZed
In case others discover this old question like I did, a more recent option:
Ctrl and arrow keys doesn't work in putty! What perform I do?
putty inverts the sense of the cursor crucial mode on ctrl, which can be a little bit hard for tmux to identify correctly. To obtain ctrl keys correct, alter the terminfo configurations so kUP5 (Ctrl-Up etc) are usually the altered versions, and disable smkx/rmkx so tmux doesn't switch the setting. For example with this range in.tmux.conf (supposing you have got TERM arranged to xterm):
fixed -gary the gadget guy terminal-overrides 'xterm.:kLFT5=eOD:kRIT5=eOC:kUP5=eOA:kDN5=eOB:smkx@:rmkx@'
Take note that this will just work in tmux 1.2 and over.
Collin GradyCollin Grady
You should appear into the documents of terminfo, ncurses, display screen and putty if you wish to debug/configure correctly. Furthermore bash cutting corners can be configured with inputrc. Look into the man webpages of party and research for inputrc.
Mircea VutcoviciMircea Vutcovici13.3k33 yellow metal badges3939 silver badges6767 bronze badges
Perform you possess the right character development in Putty ? If you link to a machine in UTF-8 and your putty is in standard charset, in vim, the arrow keys are usually written. If Putty can be in UTF-8, you can move your cursor. Probably it is the same in your case.
DomDom5,73811 yellow metal badge1515 sterling silver badges2222 bronze badges
In your putty settings under Airport -gt; Functions, there's a several 'disable' checkboxes. You may would like to try out disabling program cursor keys or program keypad setting - occasionally putty attempts to end up being 'as well clever' and sends control people that aren'capital t suitable with the machine.
tylerltylerl12.9k44 platinum badges4141 gold badges6868 bronze badges
I'michael using the Port gt; Keyboard gt; Function Secrets gt; Xterm R6That assists with htop (f4 lookup etc ) functionality keys working as anticipated.
What I've discovered out is that, rather of using CTRL + arrow, ALT + arrow gets words instead.
DanDan
Not the reply you're searching for? Search other questions marked bashgnu-screenputty or ask your personal query.
I'meters making use of putty on earn7 as client, to sign into ssh on a debian server. But I've met a strange issue about key pad manners on putty system.
I noticed that it's i9000 about key pad config in putty. After reading the guide of putty, I successfully made
backspace
key to function, but nevertheless have troubles aboutESC
, arrows,home
andfinish
, andF1
-Y12
keys.Right here I listing their actions below. It seems that the mismapping of
ESC
is usually the root result in.ESC
=gt; ^up
=gt; ^OAdown
=gt; ^OBright
=gt; ^OCstill left
=gt; ^ODhouse
=gt; ^1end
=gt; ^4F1
=gt; ^11Y12
=gt; ^24
Right here I will show why I believe esc is usually mismapping:
When in a correctly working ssh console, I press
esc
, it should show nothing.But in this malfunctioning ssh gaming console, I press
esc
, it shows^
.I ran od -g on both ssh system, and pressed
esc
, they offered the same output.Rufus
RufusRufus
5 Answers
The problem can be the worth of the TERM environment variable will not fit the set up terminal characteristics - particularly the 'Home and End keys' and 'Functionality keys and keypad' settings.
These can become tough to obtain right.
What can be anticipated by the Debian server.
Type
infocmp -I
to see what your personal computer is expecting.khome=EH
means that the server wants to receive three charactersESC L
when you pushHouse.You can appear at what is expected for various other values of Expression
Here you can notice that, if
Phrase
had been fixed toxterm
, this machine would anticipate to receiveESC 1
whenHomeis certainly pushed (khome
)If the over is too cryptic, attempt
infocmp -M
You can furthermore do stuff like
tput khome hexdump -D
if you understand the terminfo ability names for the keys you are usually serious in.or, perhaps more legibly
or to observe what another TERM setting might mean
if the result is clear the machine feels that airport kind (Phrase) doesn't possess that essential.
What will be actually delivered by Putty.
To notice whatHousein fact sends, run
vi
, presswe(for insert mode) pressCtrl+Sixth is vafter that pushHouseand pressEscto exit insert setting.Remedy
Adjust Putty config (or Phrase) until what is usually sent fits what the additional end anticipated.
E.h.
Do as given in https://www.chiark.greenend.org.uk/sgtatham/putty/wishlist/terminfo.html then in Putty, Settings, Connection, Data, terminal-type line = PuTTY and save that. Probably.
RedGrittyBrickRedGrittyBrick68.2k1414 yellow metal badges107107 silver badges165165 bronze badges
There is usually no mismapping of theESCessential - ^ methods Control-LeftSquareBracket which is ASCII 27 which is usually ESC
If you suspect the keys to provide wrong sequences, verify them withod -cand evaluate them to theinfocmpresult:
Output may become (
033
is certainlyESC):Compare it to the result of infocmp (here
At the
indicatesESC):Short introduction to infocmp result:
kbs
= Backspacekcub1
,kcud1
,kcuf1
,kcuu1
= Cursor Secretskf
. = Functionality keyskpp
/knp
= Web page up/downkhome
/kend
= Home / End keyskich1
/kdch1
= Put in / Delete keysMaking use of these Data it should end up being easy to configure yourputtyfor your system correctly.
ktfktf2,10811 gold logo99 sterling silver badges1212 bronze badges
In my experience it's because bash is usually not running, simply operate/bin/bashto take pleasure in colors, background and more. And those glitches disappear furthermore, making the key pad working as anticipated.
You may have got to run this command every time you link or modify user, but it's not tough to keep in mind.
JoelBonetRJoelBonetR
Until you discover a complete solution attempt using vi-style keys instead of the arrows.
H =gt; still left
J =gt; down
etc.
YitzchakYitzchakH =gt; still left
J =gt; down
etc.
2,68955 magic badges2222 sterling silver badges3838 bronze badges
Certainly there is a 'recipe', but PuTTY't developers select to not participate in the procedure. The formula is known to as aterminal explanation. There'beds been a appropriate one in ncurses since 2001 (find link for illustration to fatal data source).
The airport terminal description will be given to most programs as the
Expression
atmosphere adjustable.Rather than use that 'formula', PuTTY by default units
Phrase
toxterm
, which as you possess noticed, does not suit the particular keys (function, cursor). That's i9000 pointed out in the ncurses FAQ Why not just use Expression set to 'xterm'?PuTTY can be also stated (because of the issue with
Thomas DickeyThomas DickeyTERM
) in the xterm Common questions, although there is definitely no area dedicated to it, because it will be not actually an 'xterm'.6,38622 platinum badges1313 silver badges2626 bronze badges