patch 9.2.0536: tests: Test_invalid_args() fails on GTK4 without xterm_clipboard

Problem:  tests: Test_invalid_args() fails on GTK4 builds when
          xterm_clipboard is not enabled
Solution: Add has('xterm_clipboard') check to the test, while at it,
          also document the --display argument.

closes: #20318

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2026-05-25 16:59:58 +00:00
parent dfdeba16d7
commit 7e55dae2fe
6 changed files with 138 additions and 112 deletions
+7 -1
View File
@@ -1,4 +1,4 @@
*starting.txt* For Vim version 9.2. Last change: 2026 Apr 29
*starting.txt* For Vim version 9.2. Last change: 2026 May 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -642,6 +642,12 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
of the output is: >
WID: 12345\n
--display {display} *--display*
Run Vim on {display}, connecting to that X server instead of
the one in $DISPLAY. The "--display" long form is accepted
only by the GTK+ 2 or GTK+ 3 GUI, see also |-display|.
{requires the |+xterm_clipboard| feature}
--role {role} *--role*
GTK+ 2 GUI only. Set the role of the main window to {role}.
The window role can be used by a window manager to uniquely
+1
View File
@@ -1591,6 +1591,7 @@ $quote eval.txt /*$quote*
--clean starting.txt /*--clean*
--clientserver remote.txt /*--clientserver*
--cmd starting.txt /*--cmd*
--display starting.txt /*--display*
--echo-wid starting.txt /*--echo-wid*
--gui-dialog-file starting.txt /*--gui-dialog-file*
--help starting.txt /*--help*
+12 -1
View File
@@ -1,4 +1,4 @@
.TH VIM 1 "2025 Jun 27"
.TH VIM 1 "2026 May 22"
.SH NAME
vim \- Vi IMproved, a programmer's text editor
.SH SYNOPSIS
@@ -194,6 +194,17 @@ Start
.B Vim
in Ex mode, just like the executable was called "ex".
.TP
\-display {display}
Run
.B Vim
on
.IR {display} ,
connecting to that X server instead of the one in $DISPLAY.
The "\-\-display" long form is accepted only by the GTK+ 2 or GTK+ 3 GUI.
Both forms require the
.B +xterm_clipboard
feature.
.TP
\-E
Start
.B Vim
+115 -109
View File
@@ -137,59 +137,65 @@ OPTIONS
-e Start Vim in Ex mode, just like the executable was called
"ex".
-display {display}
Run Vim on {display}, connecting to that X server instead
of the one in $DISPLAY. The "--display" long form is ac
cepted only by the GTK+ 2 or GTK+ 3 GUI. Both forms re
quire the +xterm_clipboard feature.
-E Start Vim in improved Ex mode, just like the executable was
called "exim".
-f Foreground. For the GUI version, Vim will not fork and de
tach from the shell it was started in. On the Amiga, Vim
is not restarted to open a new window. This option should
be used when Vim is executed by a program that will wait
for the edit session to finish (e.g. mail). On the Amiga
tach from the shell it was started in. On the Amiga, Vim
is not restarted to open a new window. This option should
be used when Vim is executed by a program that will wait
for the edit session to finish (e.g. mail). On the Amiga
the ":sh" and ":!" commands will not work.
-F If Vim has been compiled with FKMAP support for editing
right-to-left oriented files and Farsi keyboard mapping,
this option starts Vim in Farsi mode, i.e. 'fkmap' and
'rightleft' are set. Otherwise an error message is given
-F If Vim has been compiled with FKMAP support for editing
right-to-left oriented files and Farsi keyboard mapping,
this option starts Vim in Farsi mode, i.e. 'fkmap' and
'rightleft' are set. Otherwise an error message is given
and Vim aborts.
Note: Farsi support has been removed in patch 8.1.0932.
-g If Vim has been compiled with GUI support, this option en
-g If Vim has been compiled with GUI support, this option en
ables the GUI. If no GUI support was compiled in, an error
message is given and Vim aborts.
-H If Vim has been compiled with RIGHTLEFT support for editing
right-to-left oriented files and Hebrew keyboard mapping,
this option starts Vim in Hebrew mode, i.e. 'hkmap' and
'rightleft' are set. Otherwise an error message is given
right-to-left oriented files and Hebrew keyboard mapping,
this option starts Vim in Hebrew mode, i.e. 'hkmap' and
'rightleft' are set. Otherwise an error message is given
and Vim aborts.
-i {viminfo}
Specifies the filename to use when reading or writing the
viminfo file, instead of the default "~/.viminfo". This
can also be used to skip the use of the .viminfo file, by
Specifies the filename to use when reading or writing the
viminfo file, instead of the default "~/.viminfo". This
can also be used to skip the use of the .viminfo file, by
giving the name "NONE".
-l Lisp mode. Sets the 'lisp' and 'showmatch' options on.
-L Same as -r.
-m Modifying files is disabled. Resets the 'write' option.
You can still modify the buffer, but writing a file is not
-m Modifying files is disabled. Resets the 'write' option.
You can still modify the buffer, but writing a file is not
possible.
-M Modifications not allowed. The 'modifiable' and 'write'
options will be unset, so that changes are not allowed and
files can not be written. Note that these options can be
-M Modifications not allowed. The 'modifiable' and 'write'
options will be unset, so that changes are not allowed and
files can not be written. Note that these options can be
set to enable making modifications.
-n No swap file will be used. Recovery after a crash will be
impossible. Handy if you want to edit a file on a very
slow medium (e.g. floppy). Can also be done with ":set
-n No swap file will be used. Recovery after a crash will be
impossible. Handy if you want to edit a file on a very
slow medium (e.g. floppy). Can also be done with ":set
uc=0". Can be undone with ":set uc=200".
-N No-compatible mode. Resets the 'compatible' option. This
will make Vim behave a bit better, but less Vi compatible,
-N No-compatible mode. Resets the 'compatible' option. This
will make Vim behave a bit better, but less Vi compatible,
even though a .vimrc file does not exist.
-nb Become an editor server for NetBeans. See the docs for de
@@ -198,144 +204,144 @@ OPTIONS
-o[N] Open N windows stacked. When N is omitted, open one window
for each file.
-O[N] Open N windows side by side. When N is omitted, open one
-O[N] Open N windows side by side. When N is omitted, open one
window for each file.
-p[N] Open N tab pages. When N is omitted, open one tab page for
each file.
-P {parent-title}
Win32 GUI only: Specify the title of the parent applica
tion. When possible, Vim will run in an MDI window inside
the application. {parent-title} must appear in the window
Win32 GUI only: Specify the title of the parent applica
tion. When possible, Vim will run in an MDI window inside
the application. {parent-title} must appear in the window
title of the parent application. Make sure that it is spe
cific enough. Note that the implementation is still primi
tive. It won't work with all applications and the menu
cific enough. Note that the implementation is still primi
tive. It won't work with all applications and the menu
doesn't work.
-r List swap files, with information about using them for re
-r List swap files, with information about using them for re
covery.
-r {file} Recovery mode. The swap file is used to recover a crashed
editing session. The swap file is a file with the same
-r {file} Recovery mode. The swap file is used to recover a crashed
editing session. The swap file is a file with the same
filename as the text file with ".swp" appended. See ":help
recovery".
-R Read-only mode. The 'readonly' option will be set. You
-R Read-only mode. The 'readonly' option will be set. You
can still edit the buffer, but will be prevented from acci
dentally overwriting a file. If you do want to overwrite a
file, add an exclamation mark to the Ex command, as in
":w!". The -R option also implies the -n option (see
above). The 'readonly' option can be reset with ":set
file, add an exclamation mark to the Ex command, as in
":w!". The -R option also implies the -n option (see
above). The 'readonly' option can be reset with ":set
noro". See ":help 'readonly'".
-s Silent mode. Only when started as "Ex" or when the "-e"
-s Silent mode. Only when started as "Ex" or when the "-e"
option was given before the "-s" option.
-s {scriptin}
The script file {scriptin} is read. The characters in the
file are interpreted as if you had typed them. The same
The script file {scriptin} is read. The characters in the
file are interpreted as if you had typed them. The same
can be done with the command ":source! {scriptin}". If the
end of the file is reached before the editor exits, further
characters are read from the keyboard.
-S {file} {file} will be sourced after the first file has been read.
This is equivalent to -c "source {file}". {file} cannot
-S {file} {file} will be sourced after the first file has been read.
This is equivalent to -c "source {file}". {file} cannot
start with '-'. If {file} is omitted "Session.vim" is used
(only works when -S is the last argument).
-T {terminal}
Tells Vim the name of the terminal you are using. Only re
quired when the automatic way doesn't work. Should be a
terminal known to Vim (builtin) or defined in the termcap
quired when the automatic way doesn't work. Should be a
terminal known to Vim (builtin) or defined in the termcap
or terminfo file.
-u {vimrc} Use the commands in the file {vimrc} for initializations.
All the other initializations are skipped. Use this to
edit a special kind of files. It can also be used to skip
all initializations by giving the name "NONE". See ":help
-u {vimrc} Use the commands in the file {vimrc} for initializations.
All the other initializations are skipped. Use this to
edit a special kind of files. It can also be used to skip
all initializations by giving the name "NONE". See ":help
initialization" within vim for more details.
-U {gvimrc} Use the commands in the file {gvimrc} for GUI initializa
tions. All the other GUI initializations are skipped. It
can also be used to skip all GUI initializations by giving
the name "NONE". See ":help gui-init" within vim for more
-U {gvimrc} Use the commands in the file {gvimrc} for GUI initializa
tions. All the other GUI initializations are skipped. It
can also be used to skip all GUI initializations by giving
the name "NONE". See ":help gui-init" within vim for more
details.
-v Start Vim in Vi mode, just like the executable was called
"vi". This only has effect when the executable is called
-v Start Vim in Vi mode, just like the executable was called
"vi". This only has effect when the executable is called
"ex".
-V[N] Verbose. Give messages about which files are sourced and
for reading and writing a viminfo file. The optional num
-V[N] Verbose. Give messages about which files are sourced and
for reading and writing a viminfo file. The optional num
ber N is the value for 'verbose'. Default is 10.
-V[N]{filename}
Like -V and set 'verbosefile' to {filename}. The result is
that messages are not displayed but written to the file
that messages are not displayed but written to the file
{filename}. {filename} must not start with a digit.
-w{number} Set the 'window' option to {number}.
-w {scriptout}
All the characters that you type are recorded in the file
{scriptout}, until you exit Vim. This is useful if you
want to create a script file to be used with "vim -s" or
All the characters that you type are recorded in the file
{scriptout}, until you exit Vim. This is useful if you
want to create a script file to be used with "vim -s" or
":source!". If the {scriptout} file exists, characters are
appended.
-W {scriptout}
Like -w, but an existing file is overwritten.
-x If Vim has been compiled with encryption support, use en
-x If Vim has been compiled with encryption support, use en
cryption when writing files. Will prompt for a crypt key.
-X Don't connect to the X server. Shortens startup time in a
terminal, but the window title and clipboard will not be
-X Don't connect to the X server. Shortens startup time in a
terminal, but the window title and clipboard will not be
used.
-Y Don't connect to the wayland compositor
-y Start Vim in easy mode, just like the executable was called
"evim" or "eview". Makes Vim behave like a click-and-type
"evim" or "eview". Makes Vim behave like a click-and-type
editor.
-Z Restricted mode. Works like the executable starts with
-Z Restricted mode. Works like the executable starts with
"r".
-- Denotes the end of the options. Arguments after this will
be handled as a file name. This can be used to edit a
-- Denotes the end of the options. Arguments after this will
be handled as a file name. This can be used to edit a
filename that starts with a '-'.
--clean Do not use any personal configuration (vimrc, plugins,
etc.). Useful to see if a problem reproduces with a clean
--clean Do not use any personal configuration (vimrc, plugins,
etc.). Useful to see if a problem reproduces with a clean
Vim setup.
--cmd {command}
Like using "-c", but the command is executed just before
processing any vimrc file. You can use up to 10 of these
Like using "-c", but the command is executed just before
processing any vimrc file. You can use up to 10 of these
commands, independently from "-c" commands.
--echo-wid GTK GUI only: Echo the Window ID on stdout.
--gui-dialog-file {name}
When using the GUI, instead of showing a dialog, write the
title and message of the dialog to file {name}. The file
is created or appended to. Only useful for testing, to
avoid that the test gets stuck on a dialog that can't be
When using the GUI, instead of showing a dialog, write the
title and message of the dialog to file {name}. The file
is created or appended to. Only useful for testing, to
avoid that the test gets stuck on a dialog that can't be
seen. Without the GUI the argument is ignored.
--help, -h, -?
Give a bit of help about the command line arguments and op
tions. After this Vim exits.
--literal Take file name arguments literally, do not expand wild
cards. This has no effect on Unix where the shell expands
--literal Take file name arguments literally, do not expand wild
cards. This has no effect on Unix where the shell expands
wildcards.
--log {filename}
If Vim has been compiled with eval and channel feature,
start logging and write entries to {filename}. This works
If Vim has been compiled with eval and channel feature,
start logging and write entries to {filename}. This works
like calling ch_logfile({filename}, 'ao') very early during
startup.
@@ -345,8 +351,8 @@ OPTIONS
--noplugin Skip loading plugins. Implied by -u NONE.
--not-a-term
Tells Vim that the user knows that the input and/or output
is not connected to a terminal. This will avoid the warn
Tells Vim that the user knows that the input and/or output
is not connected to a terminal. This will avoid the warn
ing and the two second delay that would happen.
--remote Connect to a Vim server and make it edit the files given in
@@ -354,18 +360,18 @@ OPTIONS
is given and the files are edited in the current Vim.
--remote-expr {expr}
Connect to a Vim server, evaluate {expr} in it and print
Connect to a Vim server, evaluate {expr} in it and print
the result on stdout.
--remote-send {keys}
Connect to a Vim server and send {keys} to it.
--remote-silent
As --remote, but without the warning when no server is
As --remote, but without the warning when no server is
found.
--remote-wait
As --remote, but Vim does not exit until the files have
As --remote, but Vim does not exit until the files have
been edited.
--remote-wait-silent
@@ -376,11 +382,11 @@ OPTIONS
List the names of all Vim servers that can be found.
--servername {name}
Use {name} as the server name. Used for the current Vim,
Use {name} as the server name. Used for the current Vim,
unless used with a --remote argument, then it's the name of
the server to connect to. If the socketserver backend is
the server to connect to. If the socketserver backend is
being used, if the name starts with "/", "./", or "../", it
is taken as either an absolute, relative or relative path
is taken as either an absolute, relative or relative path
to the socket.
--clientserver {backend}
@@ -391,37 +397,37 @@ OPTIONS
dows.
--socketid {id}
GTK GUI only: Use the GtkPlug mechanism to run gVim in an
GTK GUI only: Use the GtkPlug mechanism to run gVim in an
other window.
--startuptime {file}
During startup write timing messages to the file {fname}.
--ttyfail When stdin or stdout is not a terminal (tty) then exit
--ttyfail When stdin or stdout is not a terminal (tty) then exit
right away.
--version Print version information and exit.
--windowid {id}
Win32 GUI only: Make gVim try to use the window {id} as a
Win32 GUI only: Make gVim try to use the window {id} as a
parent, so that it runs inside that window.
ON-LINE HELP
Type ":help" in Vim to get started. Type ":help subject" to get help
on a specific subject. For example: ":help ZZ" to get help for the
"ZZ" command. Use <Tab> and CTRL-D to complete subjects (":help cmd
line-completion"). Tags are present to jump from one place to another
Type ":help" in Vim to get started. Type ":help subject" to get help
on a specific subject. For example: ":help ZZ" to get help for the
"ZZ" command. Use <Tab> and CTRL-D to complete subjects (":help cmd
line-completion"). Tags are present to jump from one place to another
(sort of hypertext links, see ":help"). All documentation files can be
viewed in this way, for example ":help syntax.txt".
FILES
/usr/local/share/vim/vim??/doc/*.txt
The Vim documentation files. Use ":help doc-file-list"
The Vim documentation files. Use ":help doc-file-list"
to get the complete list.
vim?? is short version number, like vim91 for Vim 9.1
/usr/local/share/vim/vim??/doc/tags
The tags file used for finding information in the docu
The tags file used for finding information in the docu
mentation files.
/usr/local/share/vim/vim??/syntax/syntax.vim
@@ -434,18 +440,18 @@ FILES
System wide Vim initializations.
~/.vimrc, ~/.vim/vimrc, $XDG_CONFIG_HOME/vim/vimrc
Your personal Vim initializations (first one found is
Your personal Vim initializations (first one found is
used).
/usr/local/share/vim/gvimrc
System wide gvim initializations.
~/.gvimrc, ~/.vim/gvimrc, $XDG_CONFIG_HOME/vim/gvimrc
Your personal gVim initializations (first one found is
Your personal gVim initializations (first one found is
used).
/usr/local/share/vim/vim??/optwin.vim
Script used for the ":options" command, a nice way to
Script used for the ":options" command, a nice way to
view and set options.
/usr/local/share/vim/vim??/menu.vim
@@ -455,11 +461,11 @@ FILES
Script to generate a bug report. See ":help bugs".
/usr/local/share/vim/vim??/filetype.vim
Script to detect the type of a file by its name. See
Script to detect the type of a file by its name. See
":help 'filetype'".
/usr/local/share/vim/vim??/scripts.vim
Script to detect the type of a file by its contents.
Script to detect the type of a file by its contents.
See ":help 'filetype'".
/usr/local/share/vim/vim??/print/*.ps
@@ -474,17 +480,17 @@ SEE ALSO
AUTHOR
Most of Vim was made by Bram Moolenaar, with a lot of help from others.
See ":help credits" in Vim.
Vim is based on Stevie, worked on by: Tim Thompson, Tony Andrews and
Vim is based on Stevie, worked on by: Tim Thompson, Tony Andrews and
G.R. (Fred) Walter. Although hardly any of the original code remains.
BUGS
Probably. See ":help todo" for a list of known problems.
Note that a number of things that may be regarded as bugs by some, are
in fact caused by a too-faithful reproduction of Vi's behaviour. And
if you think other things are bugs "because Vi does it differently",
you should take a closer look at the vi_diff.txt file (or type :help
vi_diff.txt when in Vim). Also have a look at the 'compatible' and
Note that a number of things that may be regarded as bugs by some, are
in fact caused by a too-faithful reproduction of Vi's behaviour. And
if you think other things are bugs "because Vi does it differently",
you should take a closer look at the vi_diff.txt file (or type :help
vi_diff.txt when in Vim). Also have a look at the 'compatible' and
'cpoptions' options.
2025 Jun 27 VIM(1)
2026 May 22 VIM(1)
+1 -1
View File
@@ -637,7 +637,7 @@ func Test_invalid_args()
endfor
endif
if has('gui_gtk')
if has('gui_gtk') && has("xterm_clipboard")
let out = split(system(GetVimCommand() .. ' --display'), "\n")
call assert_equal(1, v:shell_error)
call assert_match('^VIM - Vi IMproved .* (.*)$', out[0])
+2
View File
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
536,
/**/
535,
/**/