Installed vim version with python-2.7 && python3.6.2 , lua , perl, ruby supports in Centos 7 or update vim in Fedora-26 the vim screen apprears as:
$q q
As in attached file below:
The first line always comes like this.
Kindly suggest why this happens or how to resolve this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
The same issue is discussed at #2008.
Which terminal software do you use?
I have the same issue with konsole using vim 8.0.1008.
The $q q
doesn't appear when I call vim -u NONE
, but commenting out $HOME/.vim/vimrc
, /etc/vimrc
or $VIMRUNTIME/defaults.vim
didn't fix this. ( <- still has the artifact with vim
and no artifact with vim -u NONE
)
I tried setting $TERM
to konsole-256color
(I don't think that's standard though) and the issue disappeared, tried setting it back to xterm-256color
and had the issue again.
I really don't think that I messed up with TERM
value, so Konsole handles alone this thing and sends xterm-256color
, while apparently it should not.
Please take the following into account, since the issue itself is strongly tied to what value terminals use for their $TERM
and their actual terminal capabilities:
On the command prompt of your terminal, invoke cat
without arguments. Then, type
^[P$q q^[\
where ^[
is not a series of literal ^
and [
, but a symbol representing the escape character; you can enter it by typing control-V and Esc successively in that order.
Then, press return.
In response to that, if the terminal echoes
^[P1$rX q^[\
where X = 0, 1, 2, 3, 4, 5 or 6, depending on the current cursor shape, then the terminal deserves to be called xterm, because it is exactly the same sequence that real xterm echoes. For such a terminal, it's probably OK to set $TERM
to xterm or its variant, say, xterm-256color, and $q q
is expected not to appear on Vim. If you still have it on the screen, it's a bug of Vim.
Otherwise, whatever $TERM
the terminal uses officially or nominally, it's not an xterm in that respect. If you set $TERM
to xterm or its variant, $q q
will appear on Vim's startup screen, because such terminals are unable to handle the mentioned escaped sequence ^[P$q q^[\
.
The response to the escaped sequence varies from terminal to terminal. For example, urxvt
doesn't respond to it, and st
even changes colors. Some terminals echoes the sequence as it is, thus part of it, $q q
, appearing on Vim's startup screen.
Accordingly, an obvious way to resolve the issue is: Avoid settting $TERM
to xterm or its variant if the terminal isn't an xterm or a substantially equivalent, and use the value which represents its terminal capabilities faithfully. That's a solution to the issue for now.
I did type ^[P$q q^[\
and in response the terminal gives ^[P$q q^[\
. And default value of echo $TERM after fresh install of Centos 7 /Fedora26 is xterm.
Please provide the name and the version of the terminal software, not only the setting of $TERM
.
I did type ^[P$q q^[\ and in response the terminal gives ^[P$q q^[.
Did you type Ctrl-V + Esc to input ^[
?
If not, the result is wrong.
Terminal is bash with following as version details:
GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu).
Errr... No, bash is a shell, not a terminal.
Terminals are for example: gnome-terminal, konsole, xterm, urxvt, ...
Terminal multiplexers like GNU screen and tmux are also behave as a terminal.
How to find the terminal?
I have checked on web and typed all the suggested commands etc. and got the following:
Command: ps aux | grep $(echo $$ )
Result:
amarjeet 3917 0.0 0.0 116460 3352 pts/0 S 09:13 0:00 bash amarjeet 4200 0.0 0.0 112648 956 pts/0 S+ 10:22 0:00 grep --color=auto 3917
Command: ps -p$PPID
Result:
PID TTY TIME CMD 3895 pts/0 00:00:00 bash
Command: basename "/"$(ps -f -p $(cat /proc/$(echo $$)/stat | cut -d \ -f 4) | tail -1 | sed 's/^.* //')
Result: -v
Command: ps -o 'cmd=' -p $(ps -o 'ppid=' -p $$)
Result: bash -v
Command: tty --version
Result:
tty (GNU coreutils) 8.22
But I am not getting the clear cut answer. The TERM value is set as 'xterm'
By the word "terminal", @k-takata is referring to this. Does this make sense for you? He wants to know its name. In other words, what do you call a rectangular region on a computer display inside of which bash
is waiting for your entering commands? And, what do you type in when you want such a rectangle more?
how do you start your bash
? in a graphical display environment, you usually have a terminal that is running bash and provides some means to interact with the processes like coloring, specifying font, copy paste etc. It usually has a Help menu, where when you select About, it tells you the terminal.
Also you could try something like this: pstree -p |grep $$
which e.g. shows for me:
~$: pstree -p |grep $$
| |-gnome-terminal-(34411)-+-zsh(34417)-+-pstree(35148)
If it's really 'vanilla' F26 then DE is Gnome and the terminal should be gnome-terminal.
I'm using KDE "spin" of F26, so my terminal emulator is Konsole, and there are already tickets about it https://bugs.kde.org/show_bug.cgi?id=347323 and https://bugs.kde.org/show_bug.cgi?id=383976
I tried setting $TERM to konsole-256color (I don't think that's standard though) and the issue disappeared, tried setting it back to xterm-256color and had the issue again.
Well, my terminfo database contains various konsole entries:
+chrisbra@256bit:~$ ls -1 /usr/share/terminfo/k/konsole*
/usr/share/terminfo/k/konsole
/usr/share/terminfo/k/konsole-16color
/usr/share/terminfo/k/konsole-256color
/usr/share/terminfo/k/konsole-base
/usr/share/terminfo/k/konsole-linux
/usr/share/terminfo/k/konsole+pcfkeys
/usr/share/terminfo/k/konsole-solaris
/usr/share/terminfo/k/konsole-vt100
/usr/share/terminfo/k/konsole-vt420pc
/usr/share/terminfo/k/konsole-xf3x
/usr/share/terminfo/k/konsole-xf4x
+chrisbra@256bit:~$
(not sure what to use for truecolor mode however). So I wonder, why konsole uses xterm-256color as default for $TERM.
For fedora26 its like: Gnome Terminal 3.24.2 which uses VTE - 0.48.3 + GNUTLS
For Centos 7: Gnome Terminal 3.14.3
Closed #2032.
This should be fixed by Patch 8.0.1016
If you still see this problem, please report the terminal emulator you are using
and the value of v:termresponse
Using gnome-terminal-3.22.1-2.el7.x86_64
on RHEL-7.4 (that's more or less the same as mentioned CentOS 7) I get an empty line after entering ^[P$q q^[\
into cat.
what patchlevel are you using? Also please show the value of v:termresponse
Running KDE's Konsole Version 16.12.3 and my v:termresponse
reports ^[[>0;115;0c
For what it's worth my vim is showing $q qp
. Note the p
, which may be slightly different than what we're seeing from other reports.
Setting TERM to konsole-256color is not a viable option because this breaks too many other things (for example termguicolors). The problem is there is no termcap for DECSCUSR. So while it is true Konsole is not xterm, as far as termcap is concerned TERM=xterm-256 color is correct since it implements this capability as well as xterm according to its termcap entry (that is, not at all since it doesn't exist). $TERM/termcap cannot be relied upon in this case.
Anyway, the behavior is even worse in Konsole 17.08.0 now (v:termresponse is '^[[>0;115;0c')
without t_SH= vim prints "$q qp"
with t_SH= vim prints "p"
What is the correct t_** I can set which would disable this?
@andymass and @scottchiefbaker you should probably report which version of vim you are testing with.
@mcepl The very latest on github. 8.0, included patches: 1-1026
I compiled 8.0.1026 this morning, and used it to report the above information. For now I've reverted to 8.0.972 to avoid this issue.
breaks too many other things (for example termguicolors).
Did you follow the guide at :h xterm-true-color?
@chrisbra of course, the following works (semicolons instead of colons as in doc)
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
My specific question is, what are the corresponding t_xx
codes which vim is using to know to print the $q q
and the p
(whatever actual terminal codes are)?
I can confirm that as of v8.0.130 I no longer have issues with $q q
in Konsole and Vim.
I still get �[?12$p at the first line.
gnome-terminal 2.31.3 on CentOS 6
vim 8.0.1056
v:termresponse=^[[>1;2501;0c
term=xterm or xterm-256color