feat(window): add copy_on_select option#82
Open
roramirez wants to merge 1 commit into
Open
Conversation
… copy Mouse selection (drag release and double-click word-select) copied to the clipboard unconditionally. Add a config bool `window.copy_on_select` (default true, preserving current behavior); when false the two mouse-side copy sites are skipped so the user must copy explicitly via y / Ctrl+C. The keyboard copy path is unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
window.copy_on_selectconfig option (defaulttrue, preserving today's behavior) that gates whether a mouse selection is automatically copied to the clipboard. When set tofalse, dragging a selection or double-clicking a word no longer auto-copies; the user copies explicitly withy/ Ctrl+C. The keyboard copy path (Action::Copy→do_visual_copy) is unchanged and always copies.Changes
src/config/mod.rs: addcopy_on_select: booltoWindowConfigwith#[serde(default = "default_copy_on_select")](defaulttrue).assets/config.toml: addcopy_on_select = trueto[window].src/config/tui_config.rs: addF_COPY_ON_SELECTfield to the in-process config panel (label "Copy On Select"), wired throughfrom_configandbuild_config.src/input/mouse_ops.rs: gate the two mouse-side copy calls (finish_mouse_selection,select_word_at) behindconfig.window.copy_on_select.src/input/mouse_ops_test.rs(new) verifies both mouse copy sites honor the flag; updated field-count / round-trip asserts inconfig_test.rsandtui_config_test.rs.doc/SPEC.mdconfiguration table,README.md[window]block,CHANGELOG.md.How to test
cargo test— newmouse_opstests plus updated config tests pass.cargo clippy --locked -- -D warnings— clean.copy_on_select = falsein~/.config/mmterm/config.toml, drag-select text or double-click a word, confirm the clipboard is not overwritten; pressyin Visual mode (or Ctrl+C) and confirm it copies. Set it back totrueand confirm mouse selection auto-copies again.