Skip to content

Copy mode sticky eol - #5705

Open
mgrant0 wants to merge 4 commits into
masterfrom
copy-mode-sticky-eol
Open

mgrant0 wants to merge 4 commits into
masterfrom
copy-mode-sticky-eol

Conversation

@mgrant0

@mgrant0 mgrant0 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Added new option variable copy-mode-sticky-eol default to on with existing behaviour to move cursor to the end of the line when moving up or down in copy-mode when the cursor is at the end of the line. Off means the cursor stays at the columns except if the line is shorter.

Added new copy-mode functions to control this inside copy-mode like rectangle: sticky-eol-off, sticky-eol-on, and sticky-eol-toggle.

Keep the default end-of-line rules. When copy-mode-eol is off, retain the preferred column across short lines while clamping the cursor. Preserve logical character-selection endpoints and the existing copying and newline rules.
…ggle to copy-mode commands to enable/disable this behaviour.
…-eol option (default on) and copy-mode functions sticky-eol-on, sticky-eol-off, and sticky-eol-toggle.
@nicm

nicm commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

I don't like the name sticky-eol much, I think keep-column was better.

This does not seem to work properly, try this (with mode-keys emacs):

$ PS1="01234567890123456789 "
01234567890123456789 $ echo foo; echo foo bar baz
01234567890123456789 $ tmux set -g copy-mode-sticky-eol off

Then press Up a few times, the cursor does not stay in the column it was in.

@nicm nicm moved this from Needs Work to Waiting in Open Issues & PRs Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting

Development

Successfully merging this pull request may close these issues.

2 participants