[vim/vim] guioptions=P doesn't always copy selection to the + register (Issue #19072)

18 views
Skip to first unread message

Coacher

unread,
Jan 3, 2026, 7:17:52 AM (3 days ago) Jan 3
to vim/vim, Subscribed
Coacher created an issue (vim/vim#19072)

Steps to reproduce

  1. Create any text file, e.g. lorem.txt with the Lorem ipsum ...
  2. Run gvim -u NONE -i NONE -N -c ':set guioptions=XXX' lorem.txt, where XXX is one of options below (see table).
  3. Do Visual mode select using V, Select mode select using gH, modeless select with set mouse= + mouse
  4. Inspect registers contents with :reg

Expected behaviour

set guioptions=P and set guioptions=AP should put all selections to the + register as per its description: Like autoselect but using the "+ register instead of the "* register. Right now P doesn't change any registers at all and AP changes only * for modeless selection.

set guioptions=aP and set guioptions=aAP should put modeless selection to the + register. Right now only Visual and Select mode selections are stored.

Version of Vim

VIM - Vi IMproved 9.1 (2024 Jan 02, compiled Dec 12 2025 00:00:00) Included patches: 1-1972

Environment

Fedora 43
KDE Plasma Version: 6.5.4
Qt Version: 6.10.1
Graphics Platform: Wayland

Terminal is not used here.

Logs and stack traces

|                    | Visual mode selection changes | Select mode selection changes | Modeless selection changes |
|--------------------|-------------------------------|-------------------------------|----------------------------|
| set guioptions=a   | *                             | *                             | *                          |
| set guioptions=A   |                               |                               | *                          |
| set guioptions=P   |                               |                               |                            |
| set guioptions=aA  | *                             | *                             | *                          |
| set guioptions=aP  | *, +                          | *, +                          | *                          |
| set guioptions=AP  |                               |                               | *                          |
| set guioptions=aAP | *, +                          | *, +                          | *                          |
| set guioptions=    |                               |                               |                            |


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072@github.com>

Coacher

unread,
Jan 3, 2026, 7:55:44 AM (3 days ago) Jan 3
to vim/vim, Subscribed
Coacher left a comment (vim/vim#19072)

Expected behavior:

Visual mode selection changes Select mode selection changes Modeless selection changes
set guioptions=a * * *
set guioptions=A *
set guioptions=P + + +
set guioptions=aA * * *
set guioptions=aP *, + *, +
*, +
set guioptions=AP + + *, +
set guioptions=aAP *, + *, +
*, +
set guioptions=


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3707036518@github.com>

Christian Brabandt

unread,
Jan 3, 2026, 12:32:20 PM (3 days ago) Jan 3
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#19072)

@64-bitman please


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3707224996@github.com>

Foxe Chen

unread,
Jan 3, 2026, 12:49:34 PM (3 days ago) Jan 3
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19072)

l cannot reproduce, setting guioptions=P and visual selecting some text copies the selection on my machine. Do you have any external programs running that may affect the clipboard?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3707236552@github.com>

Coacher

unread,
Jan 3, 2026, 5:38:08 PM (2 days ago) Jan 3
to vim/vim, Subscribed
Coacher left a comment (vim/vim#19072)

@64-bitman I don't run any special clipboard-related utilities, but KDE has some built-ins for clipboard management. Do you have KDE or something else?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3707416810@github.com>

Foxe Chen

unread,
Jan 3, 2026, 6:47:02 PM (2 days ago) Jan 3
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19072)

@64-bitman I don't run any special clipboard-related utilities, but KDE has some built-ins for clipboard management. Do you have KDE or something else?

I am not running KDE, however I tested in a clean Wayland environment, could you try doing that as well? Install a compositor such as LabWC and run Vim with WAYLAND_DISPLAY set to the compositor socket.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3707452932@github.com>

Coacher

unread,
Jan 4, 2026, 3:20:06 PM (2 days ago) Jan 4
to vim/vim, Subscribed
Coacher left a comment (vim/vim#19072)

I am not running KDE, however I tested in a clean Wayland environment, could you try doing that as well? Install a compositor such as LabWC and run Vim with WAYLAND_DISPLAY set to the compositor socket.

Could you please recommend a ready-made live environment for this?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3708394356@github.com>

Foxe Chen

unread,
Jan 4, 2026, 4:32:51 PM (2 days ago) Jan 4
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19072)

Well here is what I did:

  1. Install labwc and wl-clipboard from your package manager
  2. Run labwc -s 'gvim -u NONE -i NONE -N -c ":set guioptions=XXX" lorem.txt'
  3. Select text
  4. Run :!wl-paste
  5. wl-paste should output the selected text


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3708444360@github.com>

Coacher

unread,
Jan 4, 2026, 7:31:41 PM (2 days ago) Jan 4
to vim/vim, Subscribed
Coacher left a comment (vim/vim#19072)

@64-bitman I did the steps above. However, the output from :!wl-paste was empty.

Here are the versions used:

# dnf list --installed labwc wl-clipboard
Installed packages
labwc.x86_64        0.9.3-1.fc43 updates
wl-clipboard.x86_64 2.2.1-5.fc43 fedora

Also

$ wayland-info | grep -E '(ext_data_control|zwlr_data_control)'
interface: 'ext_data_control_manager_v1',                version:  1, name: 15


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3708583376@github.com>

Coacher

unread,
Jan 4, 2026, 7:34:43 PM (2 days ago) Jan 4
to vim/vim, Subscribed
Coacher left a comment (vim/vim#19072)

Another piece of the puzzle I found out randomly.

If I start and stop the visual selection, e.g. V<Esc> or VV, then the selected text is not copied.

If I do V:<Esc>, then the selected text is properly copied to the + register.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3708586448@github.com>

Foxe Chen

unread,
Jan 5, 2026, 5:43:31 PM (12 hours ago) Jan 5
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19072)

@Coacher Does this patch fix your issue?

diff --git a/src/normal.c b/src/normal.c
index 2f2a56017..0569e3b95 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -1154,7 +1154,8 @@ end_visual_mode_keep_button(void)
     // we need to paste it somewhere while we still own the selection.
     // Only do this when the clipboard is already owned.  Don't want to grab
     // the selection when hitting ESC.
-    if (clip_star.available && clip_star.owned)
+    if ((clip_star.available && clip_star.owned) ||
+	    (clip_plus.available && clip_plus.owned))
 	clip_auto_select();
 
 # if defined(FEAT_EVAL)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3712338087@github.com>

Coacher

unread,
Jan 5, 2026, 7:36:09 PM (10 hours ago) Jan 5
to vim/vim, Subscribed
Coacher left a comment (vim/vim#19072)

@64-bitman Yes, this patch fixes the problem. Thank you. Tested on 6625ba3.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3712588096@github.com>

Foxe Chen

unread,
Jan 5, 2026, 8:06:04 PM (9 hours ago) Jan 5
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19072)

@64-bitman Yes, this patch fixes the problem. Thank you. Tested on 6625ba3.

Thanks. I will make a PR soon


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/19072/3712674276@github.com>

Reply all
Reply to author
Forward
0 new messages