[vim/vim] After installation of vim version 8.0.1010 the vim-window opened with or without file name has weired first line? (#2032)

161 views
Skip to first unread message

Amarjeet Sharma

unread,
Aug 28, 2017, 11:55:34 PM8/28/17
to vim/vim, Subscribed

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:

vim-screen

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

K.Takata

unread,
Aug 29, 2017, 12:04:55 AM8/29/17
to vim/vim, Subscribed

The same issue is discussed at #2008.
Which terminal software do you use?

Gerry Agbobada

unread,
Aug 29, 2017, 5:42:16 AM8/29/17
to vim/vim, Subscribed

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.

Kazunobu Kuriyama

unread,
Aug 29, 2017, 7:44:34 AM8/29/17
to vim/vim, Subscribed

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.

Amarjeet Sharma

unread,
Aug 29, 2017, 6:50:55 PM8/29/17
to vim/vim, Subscribed

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.

K.Takata

unread,
Aug 29, 2017, 9:28:32 PM8/29/17
to vim/vim, Subscribed

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.

Amarjeet Sharma

unread,
Aug 29, 2017, 11:46:38 PM8/29/17
to vim/vim, Subscribed

Terminal is bash with following as version details:
GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu).

K.Takata

unread,
Aug 30, 2017, 12:00:43 AM8/30/17
to vim/vim, Subscribed

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.

Amarjeet Sharma

unread,
Aug 30, 2017, 1:00:26 AM8/30/17
to vim/vim, Subscribed

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'

Kazunobu Kuriyama

unread,
Aug 30, 2017, 2:50:16 AM8/30/17
to vim/vim, Subscribed

@amarjeet-cdac

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?

Christian Brabandt

unread,
Aug 30, 2017, 2:53:03 AM8/30/17
to vim/vim, Subscribed

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)

Gerry Agbobada

unread,
Aug 30, 2017, 3:26:31 AM8/30/17
to vim/vim, Subscribed

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

Christian Brabandt

unread,
Aug 30, 2017, 3:35:06 AM8/30/17
to vim/vim, Subscribed

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.

Amarjeet Sharma

unread,
Aug 30, 2017, 4:57:08 AM8/30/17
to vim/vim, Subscribed

For fedora26 its like: Gnome Terminal 3.24.2 which uses VTE - 0.48.3 + GNUTLS
For Centos 7: Gnome Terminal 3.14.3

Bram Moolenaar

unread,
Aug 30, 2017, 10:41:24 AM8/30/17
to vim/vim, Subscribed

Closed #2032.

Bram Moolenaar

unread,
Aug 30, 2017, 10:41:24 AM8/30/17
to vim/vim, Subscribed

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

Matěj Cepl

unread,
Aug 31, 2017, 1:48:54 AM8/31/17
to vim/vim, Subscribed

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.

Christian Brabandt

unread,
Aug 31, 2017, 2:37:52 AM8/31/17
to vim/vim, Subscribed

what patchlevel are you using? Also please show the value of v:termresponse

Matěj Cepl

unread,
Aug 31, 2017, 6:06:13 AM8/31/17
to vim/vim, Subscribed

Scott Baker

unread,
Aug 31, 2017, 11:16:25 AM8/31/17
to vim/vim, Subscribed

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.

Andy Massimino

unread,
Aug 31, 2017, 11:32:14 AM8/31/17
to vim/vim, Subscribed

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?

Matěj Cepl

unread,
Aug 31, 2017, 11:56:18 AM8/31/17
to vim/vim, Subscribed

@andymass and @scottchiefbaker you should probably report which version of vim you are testing with.

Andy Massimino

unread,
Aug 31, 2017, 12:02:12 PM8/31/17
to vim/vim, Subscribed

@mcepl The very latest on github. 8.0, included patches: 1-1026

Scott Baker

unread,
Aug 31, 2017, 12:15:50 PM8/31/17
to vim/vim, Subscribed

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.

Christian Brabandt

unread,
Aug 31, 2017, 2:25:58 PM8/31/17
to vim/vim, Subscribed

breaks too many other things (for example termguicolors).

Did you follow the guide at :h xterm-true-color?

Andy Massimino

unread,
Aug 31, 2017, 2:43:16 PM8/31/17
to vim/vim, Subscribed

@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)?

Scott Baker

unread,
Aug 31, 2017, 5:21:37 PM8/31/17
to vim/vim, Subscribed

I can confirm that as of v8.0.130 I no longer have issues with $q q in Konsole and Vim.

antarestrue

unread,
Sep 4, 2017, 10:45:53 PM9/4/17
to vim/vim, Subscribed

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

Bram Moolenaar

unread,
Sep 5, 2017, 3:58:52 PM9/5/17
to vim/vim, Subscribed

> 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

Well, we'll have to lower the version limit from 2800 to 2500 then...

--
hundred-and-one symptoms of being an internet addict:
86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

vim-dev ML

unread,
Sep 5, 2017, 5:35:47 PM9/5/17
to vim/vim, vim-dev ML, Your activity
vim-8.0.1035 using securecrt from vandyke and seeing this corrupting behaviour to all my sessions too.

Tried typing the escape sequence but it displays just a blank line:
> cat
^[P$q q^[\

^C

Steven Hartland

unread,
Sep 6, 2017, 1:55:27 AM9/6/17
to vim_dev, v...@noreply.github.com, subsc...@noreply.github.com, reply+00b1d1987cc700c91f6b0cf0dd84efadd4852d9...@reply.github.com, vim-dev...@256bit.org
Reply all
Reply to author
Forward
0 new messages