control-cursor-key regression in vim

Bug #89660 reported by robinharvey
32
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Feisty Backports
New
Undecided
Unassigned
GNOME Terminal
Invalid
Unknown
vim (Ubuntu)
Confirmed
Undecided
Unassigned
vte (Fedora)
New
Undecided
Unassigned
vte (Ubuntu)
Confirmed
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: vim

Hi,

On previous versions of Ubuntu, I've been able to use the key combinations Ctrl-<right-arrow> and Ctrl-<left-arrow> to move the cursor to the next and previous words, respectively in Vim (much as I am doing now in this browser text box). On Feisty, these key strokes result in the text "1;2C" or "1:5C" (for the right arrow) and "1;2D" or "1;5D" (for the left arrow) being placed in to the buffer. There doesn't seem to be much consistency as to when the "2" or "5" variants are used, i.e. repeatedly performing these key stokes outputs either variant randomly.

This problem seems to be present in both the tiny and full versions of Vim. These keystrokes work fine in the underlying terminal.

FYI, here's my setup:

Feisty AMD64 Herd 5
Gnome Desktop
Beryl installed from a 3rd party repository (with aiglx, nvidia). Please note that I have seen the same results for this problem when using Metacity, so I doubt that Beryl is causing this issue.

Many thanks,
--Robin

Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. I have been unable to reproduce this bug using vim version 7.0-164+1ubuntu6. What version do you have installed? Thanks in advance.

Changed in vim:
assignee: nobody → brian-murray
status: Unconfirmed → Needs Info
Revision history for this message
robinharvey (harvey-robin) wrote :

robin@robin-desktop:~$ dpkg -l *vim* | grep ii
ii vim-common 7.0-164+1ubuntu6 Vi IMproved - Common files
ii vim-full 7.0-164+1ubuntu6 Vi IMproved - enhanced vi editor - full fled
ii vim-gui-common 7.0-164+1ubuntu6 Vi IMproved - Common GUI files
ii vim-ruby 7.0-164+1ubuntu6 Vi IMproved - enhanced vi editor - with Ruby
ii vim-runtime 7.0-164+1ubuntu6 Vi IMproved - Runtime files

I've just upgraded (apt-get upgrade) and done a full replace of the vim packages, but still no different. I'll compare my work configs tomorrow, as these work fine (in edgy).

Many thanks,
--Robin

Revision history for this message
robinharvey (harvey-robin) wrote :

OK, I've compared the configs, and there is no discernable difference between the working and non-working versions. FYI, here are the configs I've compared:

/etc/vim/vimrc - no difference
/usr/share/vim/vim70/debian.vim - One new comment line in the feisty version

I've also tried installing a different terminal (aterm), and the problem is similar in this terminal, but with the letters "c" and "d" being inserted in to the buffer instead of "1;2D" and "1;5D".

Many thanks,
--Robin

Revision history for this message
Brian Murray (brian-murray) wrote :

I am curious to know what happens if you try this is in a text based virtual terminal i.e. vt[1-4]. As far as I know the Ctrl-<left-arrow> and Ctrl-<right-arrow> aren't key strokes supported by vim and I spent some time pouring through the manual looking for them too.

Revision history for this message
robinharvey (harvey-robin) wrote : Re: [Bug 89660] Re: cursor control regression in vim

Hi Brian,

I tried these keystrokes on vt1, and they aren't bound to anything, either
on the command line or in Vim. One thing to note is that this behavior
works fine in the terminal (Gnome Terminal) itself; if you type a few words
in to the terminal and use these keystrokes, you'll notice that the cursor
moves one word per stroke. Maybe it's this behavior I was previously using?

Many thanks,
--Robin

On 3/8/07, Brian Murray <email address hidden> wrote:
>
> I am curious to know what happens if you try this is in a text based
> virtual terminal i.e. vt[1-4]. As far as I know the Ctrl-<left-arrow>
> and Ctrl-<right-arrow> aren't key strokes supported by vim and I spent
> some time pouring through the manual looking for them too.
>
> --
> cursor control regression in vim
> https://launchpad.net/bugs/89660
>

Revision history for this message
robinharvey (harvey-robin) wrote : Re: cursor control regression in vim

Hi Brian,

I tried these keystrokes on vt1, and they aren't bound to anything, either on the command line or in Vim. One thing to note is that this behavior works fine in the terminal (Gnome Terminal) itself; if you type a few words in to the terminal and use these keystrokes, you'll notice that the cursor moves one word per stroke. Maybe it's this behavior I was previously using?

Also, I've had the chance to double-check the results I'm getting on my home machine with another machine here at work, and the results are the same (work machine is an AMD64 running Feisty.)

Many thanks,
--Robin

Revision history for this message
robinharvey (harvey-robin) wrote :

Hi,

I just tried removing the apt version of vim and installing from source, and the results are that this makes no difference. I'm pretty sure that my new source-install is not picking up any of my old apt configs, as I purged all of my vim packages before compiling:

sudo apt-get remove vim vim-common vim-full vim-gui-common vim-ruby vim-runtime
sudo apt-get autoremove
sudo dpkg --purge vim vim-common vim-full vim-gui-common vim-ruby vim-runtime
sudo apt-get build-dep vim

**Dowload, ./configure, make**
sudo checkinstall -D make install

Cheers,
--Robin

Revision history for this message
Cedric Marcone (cedric-marcone) wrote :

I can confirm it.
It worked like a charm on all previous ubuntu releases. This is a feisty primer.

Changed in vim:
assignee: brian-murray → nobody
status: Needs Info → Confirmed
Revision history for this message
Sven Herzberg (herzi) wrote :

It's still there :'(

Revision history for this message
jimmy.77 (jimmy-77) wrote :

Hi there. Same problem for me, but with some news.
I've installed latest official relelase of Ubuntu Feisty 7.04 on an HP Pavilion dv5165 laptop, and with vi (vim) editor the combos CTRL or ALT + arrow keys result in the same text (probably a codification of the combination?) 1;5C or 1;5D etc. etc.
The version of installed vim (and relative packages) is 7.0-164+1ubuntu7.
On the same machine, with previous version of vim (7.0-164+1ubuntu6~edgy1, on Ubuntu Edgy 6.10), all still work correctly.
The news is that if I connect remotely to my laptop from a machine wich not present this problem, vim works normally, and the combos gives the waited result (ex: jump to right/left word). So (at least for me) only in local vim present the abnormal behaviour.
I hope this can help you!

Regards, J.

Revision history for this message
robinharvey (harvey-robin) wrote :

Hi,

I've noticed that this bug is NOT present when using MRXVT as the underlying terminal. The MRXVT version i'm using is from apt, as is VIM, and both are at the latest feisty version. This workaround works on AMD64 and x86.

hth
--Robin

Revision history for this message
robinharvey (harvey-robin) wrote :

Sorry about the double post, I forgot to mention this....

For people who install MRXVT, you can make it look much prettier by tweaking the command used to start the terminal. Here's the command I use:

mrxvt -sl 65535 -sr -ss plain -xft -xftaa -xftmsz 10 -xftsz 10 -xftah -xftga -xftht

This makes the terminal use anti-aliased fonts (among other things) and brings the look much closer to that of gnome-terminal.

--Robin

Revision history for this message
jimmy.77 (jimmy-77) wrote :

Hi. For general knowledge: today a new release of vim is came out (7.0-164+1ubuntu7.1), but the problems with gnome-terminal remains the same :(
Cheers, J.

Revision history for this message
Steven Garrity (sgarrity) wrote :

I'm experiencing the same issue with Vim on Fedora 7. However, I only get the issue if I'm running Vim inside of Gnome Terminal. If I run Vim in xterm, the control+cursor keys move by word, as expected.

Revision history for this message
jimmy.77 (jimmy-77) wrote :

Hi again,
after made some tests I realize that only under Gnome's graphical session the problem manifest itself. I installed on the same PC several times Ubuntu 7.04 (based on Gnome 2.18) and it's sister Kubuntu 7.04 (based on KDE), but only on the firsts Vim gone "crazy"! :)
To be sure, I tried to install also an old Ubuntu 6.10 (based on Gnome 2.16) on that PC, and all works correctly.
Graphical Vim (GVim) seems to be ok for each release and for each graphical manager, but this is completely a different software and I think it share only the name with Vi. I metioned only to knowledge.
So, may be this problem related to Gnome 2.18 itself and not to Vi? Should we change board for this bug-report?

Bye, J.

Changed in gnome-terminal:
status: Unknown → Unconfirmed
Changed in gnome-terminal:
status: Unconfirmed → Confirmed
Revision history for this message
jrgns (jurgens.du.toit) wrote :

Hi.

I can comfirm this bug. I'm on Feisty, using vim 7.0.164 and gnome-terminal. I had the same problem in bash, but this was resolved by adding export INPUTRC=/etc/inputrc to /etc/bas.bashrc (see bug 89235). Although it works in the terminal, vi still gives the control codes.

J

Revision history for this message
notaz (notasas) wrote :

downgrading libvte9 package to edgy fixed the problem for me.

Revision history for this message
Micah Cowan (micahcowan) wrote :

It seems extremely likely to me that this is a bug with vte, rather than vim, so I'm reassigning.

vim is expecting the same sequences it has always expected from xterm and xterm-emulating ttys.
xterm normally sends ESC [ A for <cursor up>; when "keypad send mode" is on (vim activates this mode), it sends ESC O A instead. Regardless of mode, <control-cursor-up> is represented as ESC [ 1 ; 5 A.

gnome-terminal and xfce4-terminal (both of which use vte to handle terminal emulation), are currently sending erroneous codes for <control-cursor-up> (and others) when "keypad send mode" is on: ESC O 1 ; 5 A (which is not a valid sequence). vim doesn't recognize it, and interprets it directly, which means it is interpreted as "end input mode; open a new line above current position; start inserting 1;5A...".

Compare the following commands; after each command I am typing as input, a line consisting of <up><down><right><left>, followed by a line of the same keys with the control key held down, followed by Control-D (to terminate input to cat). Here's how it looks in xterm:

schmendrick$ cat > /dev/null
^[[A^[[B^[[C^[[D
^[[1;5A^[[1;5C^[[1;5B^[[1;5D
schmendrick$ tput smkx; cat > /dev/null; tput rmkx
^[OA^[OB^[OC^[OD
^[[1;5A^[[1;5B^[[1;5C^[[1;5D

The "tput smkx" command places the terminal into "keypad send mode"; the second tput command resets that mode. Note that while the normal cursor keys emit different sequences in the two different modes, the control-cursor-keys emit exactly the same sequences.

Here's the same thing as it looks in gnome-terminal and xfce4-terminal:

schmendrick$ cat > /dev/null
^[[A^[[B^[[C^[[D
^[[1;5A^[[1;5B^[[1;5C^[[1;5D
schmendrick$ tput smkx; cat > /dev/null; tput rmkx
^[OA^[OB^[OC^[OD
^[O1;5A^[O1;5B^[O1;5C^[O1;5D

Note that for both the normal cursor keys and the control-cursor-key combos, the "[" character in the sequence is replaced with an "O". This is more consistent, but it breaks with previous behavior, and xterm's behavior, and there is no way for vim to understand how to process these sequences (other than as literal vim commands, which is what you've seen).

Changed in vte:
assignee: nobody → desktop-bugs
importance: Undecided → Low
Revision history for this message
Anders S. Nordbø (anders-sandberg-nordbo) wrote :

How can you prioritize this low? This is very very annoying. Please consider getting this fixed asap. I'm forced to downgrade meanwhile.

Revision history for this message
Hal (hal-foobox) wrote :

Wow, as a brand new Ubuntu user coming over as a long time ~Red Hat user, this is my first negative impression. I install 7.04 flawlessly in less than hour. Very, very happy. I manually install very easily a bunch of other packages I need for both work and play in maybe another hour. I am really, really happy at this point. I then start the fine-tuning and spend maybe *six hours* to find a steenkin terminal app that works properly and that I like (has to have tabs)! ( I spend hours each day having to work via terminals connecting remotely.) Then I find this is a known issue for six months or so. Not very happy, to say the least. While apparently this is 'low priority' to gnome, fedora or ubuntu developers, it is hugely important to those who have to use terminal applications and editors like vim. .02, and I wish I knew more about apt so I get past this one. Having spent many years using multi-gnome-terminal and its little brother gnome-terminal, I guess my only choice is mrxvt. They seem like they might take this kind of thing seriously. Peace.

Revision history for this message
Sven Herzberg (herzi) wrote :

In the GNOME bugzilla someone reported that vte 0.16.8 made things working again. I built some packages from gutsy's sources (don't try to install the packages from gusty, it won't work).

You can fetch the packages from:
http://blaubeermuffin.de/vte-fix-for-ubuntu/

So, I can confirm that these packages fix the problems for feisty and I propose (request) that these packages get backported to feisty to fix this really annoying regression.

Revision history for this message
Automated Backports Builder (john-dong+backport-builder) wrote : Build Started: vte

This is a notification that the automatic backport of vte from gutsy to feisty has started.

You will be notified again once the build is finished.

For additional info and build logs, please see: http://sharkattack.media.mit.edu/inventory/check_builds/77

Thanks,

The Backports Builder

Revision history for this message
Automated Backports Builder (john-dong+backport-builder) wrote : Notification of build SUCCESS for vte

Howdy! This message is to inform you that the build you requested of vte from gutsy to feisty has been completed.
Its status is: SUCCESS
For further information, build logs, and testing .deb packages, please see: http://sharkattack.media.mit.edu/inventory/check_builds/77

Thanks,
The Backports Builder

Revision history for this message
Hal (hal-foobox) wrote :

Sven, thank you! Great news. And thanks to "Backports Builder". This made my day!!!

Revision history for this message
Sebastien Bacher (seb128) wrote :

The bug is fixed in gutsy?

Revision history for this message
Hal (hal-foobox) wrote :

I don't know. After trying both Sven's and the backports, I still am chasing this. What I have now is:

ii libvte-common 0.16.8-0ubuntu1~7.04prevu1 Terminal emulator widget for GTK+ 2.0 - comm
ii libvte-dev 0.16.8-0ubuntu1~7.04prevu1 Terminal emulator widget for GTK+ 2.0 - deve
ii libvte-doc 0.16.8-0ubuntu1~7.04prevu1 Terminal emulator widget for GTK+ 2.0 - deve
ii libvte9 0.16.8-0ubuntu1~7.04prevu1 Terminal emulator widget for GTK+ 2.0 - runt

And for end key and ctrl-end I have (using Ctrl-V + end, etc):

 halb@honey:~/debs$ end key: ^[OF
 halb@honey:~/debs$ c-end comb: ^[OF

... gnome-terminal. Then in mrxvt (which works fine in this regard):

 halb@honey:~/debs$ end key: ^[[8~
 halb@honey:~/debs$ c-end combo: ^[[8;5~

which vim understands fine.

Revision history for this message
Sven Herzberg (herzi) wrote :

Just to be sure. You restarted GNOME Terminal after installing these packages?

Both <Ctrl>Cursor-Keys, <Ctrl>End, and <Ctrl>V + End work here.

Revision history for this message
Hal (hal-foobox) wrote :

Sven, yes, I actually did a '/etc/init.d/gdm restart', just to make sure.

Revision history for this message
Per Moberg (per-moberg) wrote :

Hi,
Could someone build amd64 versions of the backports?

Thanks,
/Per

Revision history for this message
Automated Backports Builder (john-dong+backport-builder) wrote : Build Started: vte

This is a notification that the automatic backport of vte from gutsy to feisty has started.

You will be notified again once the build is finished.

For additional info and build logs, please see: http://sharkattack.media.mit.edu/inventory/check_builds/77

Thanks,

The Backports Builder

Revision history for this message
Automated Backports Builder (john-dong+backport-builder) wrote : Notification of build SUCCESS for vte

Howdy! This message is to inform you that the build you requested of vte from gutsy to feisty has been completed.
Its status is: SUCCESS
For further information, build logs, and testing .deb packages, please see: http://sharkattack.media.mit.edu/inventory/check_builds/77

Thanks,
The Backports Builder

Revision history for this message
John Dong (jdong) wrote :

I don't think this is a backports suitable bug. It should be handled via a SRU.

Changed in feisty-backports:
status: New → Invalid
Revision history for this message
robinharvey (harvey-robin) wrote : i need your urgent assistance

Hello
How are you doing today? Fine I presume. My reason for writing you a
emergency letter is that I am currently traveling in Africa, to visit
my ill Sister, am sorry for not informing you before embarking on my
journey to Africa, because the news of her illness arrived to me as "
EMERGENCY " she is suffering from a critical uterine Fibroid and needs
family support to keep her going, her condition is deteriorating and
the doctor told me that she will under-go a surgery to keep her alive
because her fibroid has gotten worse(70pounds Large) and has done a
lot of damages to her abdominal area. They will require a deposit of
$2500 because they are inviting professional surgeons from Israel to
perform the(hysterectomy) operation because it had gotten way-out of
hand for them to handle. That brings me more to why I have written
you, I need a financial help of ($2500) from you to deposit for her
surgery, and I am traveling with little cash because I didn't expect
things to be the way it is right now. I really need this money from
you soon because I am in a terrible and tight situation here, I have
48hrs to get the money before the surgeons arrive. Even if you can't
afford the whole sum, I will appreciate whatever you are able to come
up with, because I don't even know your financial status before asking
you for money. I promise to pay you back when I return.
I am desperately waiting to read from you soon so that I will know my
faith and the next step to take.
Sincerely
Mark

Revision history for this message
jrgns (jurgens.du.toit) wrote :

This seems to be fixed in the Intrepid Ibex beta?

Changed in gnome-terminal:
status: Confirmed → Invalid
Revision history for this message
Pedro Villavicencio (pedro) wrote :

Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

Changed in feisty-backports:
status: Invalid → New
Revision history for this message
joe (lastguy) wrote :

a stupid bug I can see reports on 2006, now still in 8.10, ubuntu would be better renamed as ubugtu!

Changed in vim (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.