Ubuntu

can no longer jump words with CTRL-arrow in gnome-terminal

Reported by Jos Dehaes on 2007-03-02
62
This bug affects 7 people
Affects Status Importance Assigned to Milestone
readline6 (Ubuntu)
Wishlist
Unassigned

Bug Description

Binary package hint: gnome-terminal

In edgy, one can navigate the command line with control-arrow (left/right) to jump over words. This is not possible in feisty's gnome-terminal. Instead it prints a control character as in the following example:

jos@duet-feisty ~ $ foo;5C;5D;5C;5D

As you can see, it prints a ;5C for ctrl-right and ;5D for ctrl-left.

This makes navigating a long command line cumbersome.

===WORKAROUND===

I had to create the following ~/.inputrc file to get them to work in Bash:

$include /etc/inputrc

# ZYV
#
# PageUp and PageDown don't work in Ubuntu anymore by default :-(
#
"\e[6~": end-of-history
"\e[5~": beginning-of-history

Savvas Radevic (medigeek) wrote :

Exactly the same problem here!
in edgy i had ctrl + arrow-left or ctrl + arrow-right in terminal to skip words. in ubuntu feisty when i press them it types "5D" or "5C".

Savvas Radevic (medigeek) wrote :

I forgot to add that I've noticed this change only in irssi, the ctrl+arrow works ok in a normal terminal

Jos Dehaes (jos-dehaes) wrote :

confirming as bash issue. Downgrading to edgy bash 3.1 fixed the problem. Reinstalling the feisty version breaks the jumping with ctrl-arrow again.

Andrew Marks (asmarks) wrote :

I had this same problem. I fixed it by copying these lines I found in /etc/inputrc to my existing ~/.inputrc file:
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word

rex_the_first (rex-the-first) wrote :

I have just upgraded to feisty and have this problem.

Andrew Marks solution seems to solve the problem when using bash on my own computer but I need to add this to the inputrc to all the other computers I use via SSH. Also when I use vi I get

1;5D

Instead of jumping words. Thank you for the solution but I was wondering if there is a way of fixing everywhere.

Sam Morris (yrro) wrote :

So does this mean that /etc/inputrc is no longer parsed in fiesty?

Jos Dehaes (jos-dehaes) wrote :

I just added a line to /etc/bash.bashrc:

export INPUTRC=/etc/inputrc

This seems to work for me. Perhaps the new bash in feisty looks for another file than /etc/inputrc?

Jos Dehaes (jos-dehaes) wrote :

from the bash manpage:

Readline is customized by putting commands in an initialization
file (the inputrc file). The name of this file is taken from the value of the
INPUTRC variable. If that variable is unset, the default is ~/.inputrc.

So setting the INPUTRC var somewhere in the bash rc files should fix this.

Savvas Radevic (medigeek) wrote :

is this bug the same with this one?
https://bugs.launchpad.net/bugs/104708

because for me it works ok in gnome-terminal, but it doesn't work within irssi

Savvas Radevic (medigeek) wrote :

the problem's not bash, I believe it's screen.

do:
1) open gnome-terminal
2) type screen and press enter
3) type some words (space separated)
4) hit ctrl and left arrow key
Result: you get ;5D instead of going back word by word

Same problem with ctrl-right
Until this is fixed, you can use the alternatives: ALT-B and ALT-F

same for irssi, do:
1) screen irssi
2) type some words (space separated)
3) hit ctrl and left arrow key
Result: you get 5D instead of going back word by word

Same problem with ctrl-right, alt-left and alt-right
ALT-B and ALT-F work fine

This is not bash-specific.

I see this exact problem in both zsh and irssi, when run via gnome-terminal and plain xterm.

Mario Manno (manno) wrote :

I had to update my zsh config file for the keys to workk in feisty

-bindkey '\e[5C' forward-word
-bindkey '\e[5D' backward-word
+bindkey '^[[1;5C' forward-word
+bindkey '^[[1;5D' backward-word

Now the keys work in gnome-terminal/xterm.

Bash is a different matter, though.I guess something in readline changed, maybe 8bit related?

Mario Manno (manno) wrote :

Since i can't edit my old entries:
Bash simply isn't parsing /etc/inputrc anymore and the mapping has to be "\e[1;5C" not "\e[01;5C".
Keys are still not working in vim using gnome-terminal (vte related), as described in bug #89660

kevboy (kevboy) wrote :

Try adding

$include /etc/inputrc

to your ~/.inputrc to get the default bindings.

after doing that I get:
bash: mode=emacs: command not found
bash: \e[1~:: command not found
bash: \e[4~:: command not found
bash: \e[3~:: command not found
bash: \e[2~:: command not found
bash: \e[1;5C:: command not found
bash: \e[1;5D:: command not found
bash: \e[5C:: command not found
bash: \e[5D:: command not found
bash: \e\e[C:: command not found
bash: \e\e[D:: command not found

and the Ctrl-arrows still don't work...

Any more ideas would be welcome.

Cheers,
GF

On 10/10/07, kevboy <email address hidden> wrote:
>
> Try adding
>
> $include /etc/inputrc
>
> to your ~/.inputrc to get the default bindings.
>
> --
> can no longer jump words with CTRL-arrow in gnome-terminal
> https://bugs.launchpad.net/bugs/89235
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>

--
N 50°48'40.45" E 4°25'19.69"

Jos Dehaes (jos-dehaes) wrote :

I think you added that line to .bashrc. You need to add it to .inputrc

I just checked it, that fix also works.

gratefulfrog (gratefulfrog) wrote :

Correct! That did it!

Thanks to you and to all the Ubunutu team and helpers!
RW.

On 10/10/07, Jos Dehaes <email address hidden> wrote:
>
> I think you added that line to .bashrc. You need to add it to .inputrc
>
> I just checked it, that fix also works.
>
> --
> can no longer jump words with CTRL-arrow in gnome-terminal
> https://bugs.launchpad.net/bugs/89235
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>

--
N 50°48'40.45" E 4°25'19.69"

Jos Dehaes (jos-dehaes) wrote :

Still an issue in hardy default install. As the fix is easy: add the 'export INPUTRC=/etc/inputrc' to /etc/bash.bashrc, why can this not be fixed?

Changed in bash:
status: New → Confirmed

Jos Dehaes schrieb:
> Still an issue in hardy default install. As the fix is easy: add the
> 'export INPUTRC=/etc/inputrc' to /etc/bash.bashrc, why can this not be
> fixed?

Because this overwrites your ~/.inputrc settings; please update your ~/.inputrc
or remove it if it's not needed.

Jos Dehaes (jos-dehaes) wrote :

Ok, is there a way to 'include' the /etc/inputrc in your .inputrc?

Immeëmosol (imme-emosol) wrote :

Jos Dehaes https://bugs.launchpad.net/~jos-dehaes wrote:
> Ok, is there a way to 'include' the /etc/inputrc in your .inputrc?

you could check the comment just a view above your last one:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/89235/comments/14
In that comment
kevboy https://bugs.launchpad.net/~kevboy wrote:
> Try adding
>
> $include /etc/inputrc
>
> to your ~/.inputrc to get the default bindings.

Immeëmosol (imme-emosol) wrote :

This is no bug in the program.
This is a "user bug".
If it is considered to be a bug it is a bug in realdine lib not in bash.
And the bug(or maybe even wish, since it's not really a bug, it's just something that doesn't work as expected) then would be:
/etc/inputrc should be the default for lib readline and those defaults should be able to be overridden in ~/.inputrc

Changed in bash:
status: Confirmed → Invalid
  • unnamed Edit (1.6 KiB, text/html; charset=ISO-8859-1)

Indeed, I confirm that putting that stuff in the ~/.inputrc fixed the issue!

Ciao,
GF.

On Sun, May 4, 2008 at 10:58 AM, Immeëmosol <email address hidden>
wrote:

> Jos Dehaes https://bugs.launchpad.net/~jos-dehaes<https://bugs.launchpad.net/%7Ejos-dehaes>wrote:
> > Ok, is there a way to 'include' the /etc/inputrc in your .inputrc?
>
> you could check the comment just a view above your last one:
> https://bugs.launchpad.net/ubuntu/+source/bash/+bug/89235/comments/14
> In that comment
> kevboy https://bugs.launchpad.net/~kevboy<https://bugs.launchpad.net/%7Ekevboy>wrote:
> > Try adding
> >
> > $include /etc/inputrc
> >
> > to your ~/.inputrc to get the default bindings.
>
> --
> can no longer jump words with CTRL-arrow in gnome-terminal
> https://bugs.launchpad.net/bugs/89235
> You received this bug notification because you are a direct subscriber
> of a duplicate bug.
>

--
N 50°48'40.45" E 4°25'19.69"

JW (arch0njw) wrote :

I started having this problem a while ago after an update. I was hoping that some subsequent update would fix it, but, alas, no such love.

Is there a system fix for this, or do we just need to know this piece of tribal lore to get around it?

This appears to have fixed the problem for me on Kubuntu 8.04.2 amd64.
Linux xxx 2.6.24-23-generic #1 SMP Mon Jan 26 01:04:16 UTC 2009 x86_64 GNU/Linux

Pierre Gardin (arronax50) wrote :

"""
This is no bug in the program.
This is a "user bug".
If it is considered to be a bug it is a bug in realdine lib not in bash.
And the bug(or maybe even wish, since it's not really a bug, it's just something that doesn't work as expected) then would be:
/etc/inputrc should be the default for lib readline and those defaults should be able to be overridden in ~/.inputrc
"""

Then why not include a useful ~/.inputrc with Ubuntu ? There's configuration scripts supplied with every piece of software...it's 21st century FGS.

Jonathan Marsden (jmarsden) wrote :

Logically, if the libreadline6 package were to put a one line text file into /etc/skel/.inputrc the issue would be resolved on all new machines (and all newly created user accounts) from that point forward. The file would contain the one line

$include /etc/inputrc

and would be automatically copied to each user's home directory just as .bashrc and friends are already so copied.

I can create a debdiff against readline6 which does this, if that would be helpful :)

This bug may be technically "invalid" against bash, as viewed by a developer taking a rather narrowly bash-centric view of the issue. However, the issue remains present in Ubuntu, affects more than just bash, and can be fixed rather simply, it would seem.

Was it really appropriate to mark this bug as "invalid" in these circumstances? Should I just open a new one against readline6 instead? Is there any downside to making $include /etc/inputrc the default behaviour in future?

Yury V. Zaytsev (zyv) wrote :

For me, readline misteriousely stopped processing /etc/inputrc after an update on Hardy. This started to manifest like 1-2 weeks ago. I didn't notice it straight away, so I can't tell which update was that.

I didn't have ~/.inputrc before and I didn't override /etc/inputrc. I swear it used to work before without any manual intervention. How come it suddenly stopped working? Any ideas?

Anyways, the include trick did the job for me. Thanks!

affects: bash (Ubuntu) → readline6 (Ubuntu)
Changed in readline6 (Ubuntu):
status: Invalid → Incomplete
Yury V. Zaytsev (zyv) wrote :

I re-assigned this to readline as apparently it has nothing to do with bash per se. Maybe readline folks can chime in and explain what's going on...

Yury V. Zaytsev (zyv) on 2011-04-30
Changed in readline6 (Ubuntu):
status: Incomplete → New
Roy Jamison (xteejx) wrote :

Reading through this bug report it appears that the latest tested version was Ubuntu 8.04. Can you verify if this is still a problem in 11.04 please?

Changed in readline6 (Ubuntu):
status: New → Incomplete
Yury V. Zaytsev (zyv) wrote :

I can attest that Ctrl+Arrows now work on Ubuntu 10.10, but PageUp and PageDown still don't seem to work for me. I had to create the following ~/.inputrc file to get them to work in Bash:

$include /etc/inputrc

# ZYV
#
# PageUp and PageDown don't work in Ubuntu anymore by default :-(
#
"\e[6~": end-of-history
"\e[5~": beginning-of-history

Roy Jamison (xteejx) wrote :

Thanks for the quick reply. Since this has kind of been fixed, and that the PgUp/PgDn keys still do not work (but this may be the default) I have marked it as a Wishlist item. I would suggest to re-enable this functionality permanently to contact the developers of the package directly and see if they would be willing to change the defaults back to how they were, i.e. PgUp/Dn.
Glad to see that you found a workaround, will update the description. Thank you again for helping to make Ubuntu better!

Changed in readline6 (Ubuntu):
importance: Undecided → Wishlist
status: Incomplete → Confirmed
description: updated
Alexander Kabakow (alexzak) wrote :

I wrote patch to the readline6 package, that should fix PgUp/Dn issue
It is available here https://bugs.launchpad.net/ubuntu/+source/readline6/+bug/1015744

Daniel Grund (grund) wrote :

The original issue with the CTRL-LEFT CTRL-RIGHT is not a bug.

On Ubuntu 12.04.1 LTS:

$ aptitude show libreadline5
Package: libreadline5
State: installed
Automatically installed: yes
Multi-Arch: same
Version: 5.2-11

man 3 readline:
"Readline is customized by putting commands in an initialization file
(the inputrc file). The name of this file is taken from the value of
the INPUTRC environment variable. If that variable is unset, the
default is ~/.inputrc. If that file does not exist or cannot be read,
the ultimate default is /etc/inputrc."

Thus, *deleting* ~/.inputrc solves the initially reported problem.
If one has a ~/.inputrc and wants to have system default behavior, then one also has to "$include /etc/inputrc".

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments