feat: add scroll-enter-copy-mode option#194
Conversation
마우스 스크롤 시 copy mode 자동 진입을 제어하는 `scroll-enter-copy-mode` 옵션 추가. 기본값은 `on`(기존 동작 유지). `off`로 설정하면 copy mode 없이 직접 스크롤백 탐색 가능. - `set -g scroll-enter-copy-mode off`: copy mode 없이 네이티브 스크롤 - `set -g scroll-enter-copy-mode on`: 기존 tmux 호환 동작 (기본값) - `scroll_pane_scrollback()` 헬퍼 추출로 중복 코드 제거 Closes psmux#193
When scroll-enter-copy-mode is off, scroll the pane scrollback buffer
directly instead of ignoring the wheel event entirely. This is a much
better UX: users still get scroll history navigation without being
forced into copy mode.
Changes:
copy_mode.rs : Extract scroll_pane_scrollback() helper from
scroll_copy_up/scroll_copy_down
input.rs : Use scroll_pane_scrollback when option is off
window_ops.rs : Use scroll_pane_scrollback in remote_scroll_wheel
and handle_pane_scroll when option is off
option_catalog : Add scroll-enter-copy-mode to catalog
Credit: Design inspired by jun2077681 PR #194
|
Hey @jun2077681, thank you so much for this pull request! Really appreciate you not only opening the issue but also putting together a working implementation. Your approach of extracting I've incorporated your design into the main branch (commit 6bcb9f5) and given you credit in the commit message. The implementation now includes:
Since the feature is already merged with your approach baked in, I'll close this PR. But the credit is absolutely yours for the core design. Thanks for making psmux better! |
Summary
Adds a new
scroll-enter-copy-modesession option that controls whether mouse scroll-up at a shell prompt automatically enters copy mode.set -g scroll-enter-copy-mode on(default): Existing tmux-compatible behavior — scroll up enters copy modeset -g scroll-enter-copy-mode off: Scrolls the pane scrollback directly without entering copy mode, similar to native terminal scrollingChanges
scroll-enter-copy-mode(default:on)scroll_pane_scrollback()helper fromscroll_copy_up/scroll_copy_downto eliminate code duplicationinput.rs), remote scroll (window_ops.rs::remote_scroll_wheel), and pane-targeted scroll (window_ops.rs::handle_pane_scroll)Usage
Closes #193