Bug 1123369

Summary: Running vim inside screen pressing ctrl+arrow_key deletes several lines of text
Product: [Fedora] Fedora Reporter: Stefan Assmann <sassmann>
Component: screenAssignee: Josef Ridky <jridky>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 26CC: jridky, karsten, lnykryn, mlichvar, moshima.web, phracek, sassmann, zdohnal
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: screen-4.4.0-3.fc25 screen-4.4.0-3.fc24 screen-4.4.0-3.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-29 11:55:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stefan Assmann 2014-07-25 12:42:17 UTC
Description of problem:
When running vim inside screen pressing ctrl+arrow_left or ctrl+arrow_right simultaneously deletes several lines of text. This does not happen when running vim directly in xterm for example. A workaround seems to be to add "set term=xterm" in .vimrc, but that may have various side effects.

Version-Release number of selected component (if applicable):
screen-4.1.0-0.18.20120314git3c2946.fc20.x86_64
vim-enhanced-7.4.179-1.fc20.x86_64

How reproducible:
always

Steps to Reproduce:
1. # screen
2. # vim /etc/resolv.conf
3. hit ctrl + arrow_right

Actual results:
multiple lines of text get deleted

Expected results:
nothing happens

Comment 1 Petr Hracek 2015-05-27 12:47:40 UTC
This is also reproducible in Fedora 22. Switching to F21. I have reported this bug to upstream https://lists.gnu.org/archive/html/screen-devel/2015-05/msg00004.html.

Comment 2 Fedora End Of Life 2015-11-04 11:47:55 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Fedora Admin XMLRPC Client 2016-07-11 10:24:50 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Josef Ridky 2016-08-18 12:28:49 UTC
Just add this line into ~/.screenrc file:

term xterm

This will solve described problem. This issue will be fixed in next screen release.

Comment 5 Fedora Update System 2016-09-20 07:26:00 UTC
screen-4.4.0-3.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2016-9a8463729e

Comment 6 Fedora Update System 2016-09-20 07:26:17 UTC
screen-4.4.0-3.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-29a94027ca

Comment 7 Fedora Update System 2016-09-20 07:26:28 UTC
screen-4.4.0-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-d7959377c1

Comment 8 Fedora Update System 2016-09-20 19:56:50 UTC
screen-4.4.0-3.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-9a8463729e

Comment 9 Fedora Update System 2016-09-22 01:24:43 UTC
screen-4.4.0-3.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-29a94027ca

Comment 10 Fedora Update System 2016-09-22 01:25:35 UTC
screen-4.4.0-3.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-d7959377c1

Comment 11 Fedora Update System 2016-09-27 00:36:47 UTC
screen-4.4.0-3.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2016-09-27 03:51:25 UTC
screen-4.4.0-3.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2016-10-09 09:23:26 UTC
screen-4.4.0-3.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Josef Ridky 2016-11-02 08:54:08 UTC
I have tried to fix this issue by adding some configuration command in screen. Unfortunately it happens more damages than benefits. Because of it, I have to revert these changes back to default.

I have asked screen upstream, what he thinks about this issue, and upstream is pretty sure, that this is problem of vim, not screen.

(I am not sure now, if is it problem of vim or vim-enhanced... so feel free to update this bugzilla)

Comment 15 Karsten Hopp 2016-11-02 10:47:17 UTC
Ok, if this is a Rawhide bug, could you please test it with vim-8 ? 
I've tried to reproduce it with vim-8.0.037-1.fc26 and the cursor jumps to the next word, as expected.
If that still doesn't work, try 'vim -U NONE -u NONE /etc/resolv.conf' to make sure it isn't something in your vimrc that causes this.

Comment 16 Stefan Assmann 2016-11-21 14:29:15 UTC
Hi Karsten,

I've updated a VM to rawhide for testing.
vim-enhanced-8.0.086-1.fc26.x86_64

When using 
# vim -u NONE /etc/resolv.conf
the cursor doesn't move at all when pressing ctrl + arrow_right. That's what I would expect as all vimrc files, including /etc/vimrc seem to be bypassed.

However, on this VM there are no user-specific vimrc files
# ls ~/.vim*
/home/redhat/.viminfo
but when I run
# vim /etc/resolv.conf
the problem can still bed reproduced. So it's probably related to something in /etc/vimrc or some other system config.

Another note: The problem might also be related to termcap, as the problem goes away when starting with 
# TERM=xterm vim /etc/resolv.conf
instead of
# TERM=screen vim /etc/resolv.conf

Comment 17 Fedora End Of Life 2017-02-28 09:37:32 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 18 Karsten Hopp 2017-12-12 11:23:31 UTC
This still happens when running vim inside screen in a F27 xterm. TERM gets set to 'xterm' automatically.  Setting it to 'screen.xterm-256color' seems to fix this.

I couldn't reproduce it with konsole or gnome-terminal with either TERM=xterm or TERM=screen.xterm-256color. The latter one gets set automatically when screen starts up.

It is strange that screen doesn't set TERM to screen.xterm-256color in an xterm when it does that in other terminals.

Again, running this inside screen:
 TERM=xterm vim /etc/resolv.conf  
works in konsole and gnome-terminal
fails in xterm (but works without screen)

 TERM=screen.xterm-256color vim /etc/resolv.conf 
works in konsole, gnome-terminal and xterm

Comment 19 Fedora End Of Life 2018-05-03 08:13:14 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 20 Fedora End Of Life 2018-05-29 11:55:39 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.