You are not logged in.

#1 2007-07-13 18:57:07

esauve
Member
Registered: 2007-07-13
Posts: 16

ctrl-left arrow & ctrl-right arrow not assigned in bash

In most other other distros I worked with, the CTRL-Left arrow and CTRL-right arrow will move one word to the left (or right) in a shell or a term (ex. gnome-terminal) but doesn't do anything under Arch. How/where can I assign these key combinations under Arch? TIA

Offline

#2 2007-07-13 19:38:16

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: ctrl-left arrow & ctrl-right arrow not assigned in bash

My left alt button has this behavior here.

Offline

#3 2007-07-13 21:19:19

rson451
Member
From: Annapolis, MD USA
Registered: 2007-04-15
Posts: 1,233
Website

Re: ctrl-left arrow & ctrl-right arrow not assigned in bash

im not exactly sure esuave, but you may wanna look at the ~/.inputrc file. may be /etc/inputrc if you dont have one in your home directory.

edit:

"\eOd": backward-word
"\eOc": forward-word

in ~/.inputrc may do the trick.

Last edited by rson451 (2007-07-13 21:22:52)


archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson

Offline

#4 2007-07-14 08:56:07

[vEX]
Member
From: Sweden
Registered: 2006-11-23
Posts: 450

Re: ctrl-left arrow & ctrl-right arrow not assigned in bash

Cool, that's something I've always missed. Thanks! :-D


PC: Antec P182B | Asus P8Z77-V PRO | Intel i5 3570k | 16GB DDR3 | GeForce 450GTS | 4TB HDD | Pioneer BDR-207D | Asus Xonar DX | Altec Lansing CS21 | Eizo EV2736W-BK | Arch Linux x86_64
HTPC: Antec NSK2480 | ASUS M3A78-EM (AMD 780G) | AMD Athlon X3 425 | 8GB DDR2 | GeForce G210 | 2TB HDD | Arch Linux x86_64
Server: Raspberry Pi (model B) | 512MB RAM | 750GB HDD | Arch Linux ARM

Offline

#5 2007-07-14 20:56:03

esauve
Member
Registered: 2007-07-13
Posts: 16

Re: ctrl-left arrow & ctrl-right arrow not assigned in bash

Thanks for the reply rson451. Unfortunately, it didn't work. I tried adding it to both /etc/inputrc and ~/.inputrc. I tried finding where other distros store these entries with no success...

Offline

#6 2007-07-15 14:09:37

bboozzoo
Member
From: Poland
Registered: 2006-08-01
Posts: 125

Re: ctrl-left arrow & ctrl-right arrow not assigned in bash

if bash is working in emacs mode then meta+b, moves backward, meta+f moves forward word-wise

Offline

#7 2007-07-21 02:52:52

esauve
Member
Registered: 2007-07-13
Posts: 16

Re: ctrl-left arrow & ctrl-right arrow not assigned in bash

Ok I finally figured it out. To say that it was a learning experience would be an understatement.

I added the following 4 lines in /etc/inputrc

"\e[1;5C": forward-word
"\e\e[C": forward-word
"\e[1;5D": backward-word
"\e\e[D": backward-word

I discovered that these new entries do not apply to a standard console (getty?) and only works within an ssh session or inside a term of some sort (i.e. gnome-terminal). Hopefully this will be useful to someone else.

Offline

Board footer

Powered by FluxBB