Skip to content

Implement option to ignore pasted text in normal mode - #1271

Merged
flyingmutant merged 2 commits into
cmus:masterfrom
pgaskin:bracketed-paste
Aug 1, 2023
Merged

flyingmutant merged 2 commits into
cmus:masterfrom
pgaskin:bracketed-paste

Conversation

@pgaskin

@pgaskin pgaskin commented Jul 16, 2023 •

Copy link
Copy Markdown
Member

This uses bracketed paste, where supported (xterm, win10, iterm2, etc), to prevent pasted text from being interpreted as commands unless the new block_key_paste option is disabled.

closes #1270

@pgaskin pgaskin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with xfce4-terminal. Works as expected.

  • Terminals not supporting bracketed paste should ignore the enable/disable control sequence (tested by changing the number to a non-existent one, plus this is the same as how nano does it).
  • Same behaviour as before when disabled.
  • Ignores pasted text (except when in command/search mode) when enabled. Tested both Ctrl+Shift+v and middle-click.
  • CSI parsing works correctly and follows the spec.

https://copr.fedorainfracloud.org/coprs/pgaskin/cmus-testing/build/6176496/
https://github.com/pgaskin/cmus/commits/001f1a4806e48c9f298e41d047e43d669c9475c8
https://nightly.link/pgaskin/rpms/actions/runs/5568630004

@pgaskin

pgaskin commented Jul 16, 2023

Copy link
Copy Markdown
Member Author

@flyingmutant

@flyingmutant

Copy link
Copy Markdown
Member

Thanks, will review later this week.

@pgaskin
pgaskin force-pushed the bracketed-paste branch 2 times, most recently from 5994f33 to 1e0f04e Compare July 16, 2023 17:42
Comment thread options.c Resolved
Comment thread ui_curses.c Resolved
Comment thread ui_curses.c Resolved
Comment thread ui_curses.c Resolved
@pgaskin
pgaskin marked this pull request as draft July 22, 2023 22:42
@pgaskin
pgaskin marked this pull request as ready for review July 22, 2023 22:58

@pgaskin pgaskin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@flyingmutant
flyingmutant merged commit 9a417ae into cmus:master Aug 1, 2023
@pgaskin
pgaskin deleted the bracketed-paste branch September 11, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent accidental input

3 participants