Skip to content

more flexible copy-on-select and middle-click-action #12600

Description

@jcollie

copy-on-select should be modified to be more flexible. It should support none, primary, clipboard, both
The default should be primary. true will be an alias for primary, false will be an alias for none. On systems that do not have the concept of a primary clipboard primary should be a no-op.

middle-click-action should be modified with the options ignore, paste-primary, paste-clipboard. On systems that do not have the concept of a primary clipboard paste-primary should be a no-op.

Modifying copy-on-select or middle-click-action should have no effect on the operation of the other.

Verbiage around copying/pasting should be update to refer to only primary and clipboard since those are the standard terms. selection seems a bit too ambiguous.

Discussed in #12573

Originally posted by mohshami May 3, 2026
In Linux, terminal emulators have the following behavior

Middle-click always pastes from the PRIMARY/SELECTION clipboard.
Paste action (Normally ctrl+shift+V) always pastes from CLIPBOARD.

This behavior persists regardless of the copy-on-select option (for those terminal emulators that support it)

That behavior was added to Ghostty in #2347, along with the documentation below

# Whether to automatically copy selected text to the clipboard. `true`
# will prefer to copy to the selection clipboard, otherwise it will copy to
# the system clipboard.
#
# The value `clipboard` will always copy text to the selection clipboard
# as well as the system clipboard.
#
# Middle-click paste will always use the selection clipboard. Middle-click
# paste is always enabled even if this is `false`.
#
# The default value is true on Linux and macOS.
copy-on-select = true

#12443 broke that, making Ghostty behave differently from all other emulators on Linux.

I am not sure how terminal emulators behave in MacOS, I think #12443 should be limited to MacOS or a 4th option needs to be added to copy-on-select to modify CLIPBOARD but keep middle click paste from SELECTION.

Since #12443 is scheduled for 1.4, I think more people will see the difference once that out

I can't stress enough how much I appreciate the colossal amount of work everyone is putting. Thank you all

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyA well-scoped, approachable issue for someone looking to contribute.guiGUI or app issue regardless of platform (i.e. Swift, GTK)inputKeyboard or mouse input

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions