According to https://github.com/vim/vim/issues/2008#issuecomment-324476312 This is the usual problem of setting 'term' to "xterm", while the terminal is not actually xterm compatible. You have to set 'term' to the right value. So either we change the echo $TERM xterm-256color or ideally we make it xterm compatible I can try having a look at what needs fixing, but a pointer would be welcome :)
This comment summarizes properly what is it that's not supported by konsole: https://github.com/vim/vim/issues/2008#issuecomment-324829794 Just FYI: VTE (gnome-terminal et al) doesn't support this either (ESC P aka "device control string" is totally unsupported there), but at least silently ignores it. Probably good enough, at least people don't complain about gnome-terminal there :)
confirming here (on fedora 26). (in case it matters): $ echo $TERM xterm-256color
Just for the sake of completeness, this effects all versions of konsole back to 3.5.10.
(In reply to Rex Dieter from comment #2) > confirming here (on fedora 26). > > (in case it matters): > $ echo $TERM > xterm-256color For my arch installation I have the same as you. After editing the file ~/.local/share/konsole/Shell.profile to add a line to the end of the [general] section containing "Environment=TERM=konsole-256color" then on starting konsole the $TERM now has: $ echo $TERM konsole-256color and the problem with vim no longer occurs.
I've a very basic "fix" at https://phabricator.kde.org/D7644
Git commit 6dc09a36c106879f3b86d024e6b95ac0f5f028c8 by Albert Astals Cid. Committed on 02/09/2017 at 08:54. Pushed by aacid into branch 'master'. Ignore xterm-DCS messages Summary: Would be ideal to process them too, but they seem kind of corner case and ignoring them fixes vim having $q q written on the first line on startup Test Plan: Ran vim, looks good Should this go to 17.08 or master? Reviewers: hindenburg Reviewed By: hindenburg Subscribers: #konsole Tags: #konsole Differential Revision: https://phabricator.kde.org/D7644 M +2 -0 src/Vt102Emulation.cpp https://commits.kde.org/konsole/6dc09a36c106879f3b86d024e6b95ac0f5f028c8
Git commit f3ddd3ef301d3c1e4f51405bf9a6afdc897edd8a by Kurt Hindenburg, on behalf of Albert Astals Cid. Committed on 05/09/2017 at 13:46. Pushed by hindenburg into branch 'Applications/17.08'. Ignore xterm-DCS messages Summary: Would be ideal to process them too, but they seem kind of corner case and ignoring them fixes vim having $q q written on the first line on startup Test Plan: Ran vim, looks good Should this go to 17.08 or master? Reviewers: hindenburg Reviewed By: hindenburg Subscribers: #konsole Tags: #konsole Differential Revision: https://phabricator.kde.org/D7644 (cherry picked from commit 6dc09a36c106879f3b86d024e6b95ac0f5f028c8) M +2 -0 src/Vt102Emulation.cpp https://commits.kde.org/konsole/f3ddd3ef301d3c1e4f51405bf9a6afdc897edd8a
*** Bug 382501 has been marked as a duplicate of this bug. ***