aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/input.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/shell/input.rs')
-rw-r--r--src/client/shell/input.rs26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/client/shell/input.rs b/src/client/shell/input.rs
index eb1f8f2f..c6d458c8 100644
--- a/src/client/shell/input.rs
+++ b/src/client/shell/input.rs
@@ -14,9 +14,10 @@ pub(super) fn is_modal_paste_shortcut_for_platform(
key: &crate::input::TerminalKey,
macos: bool,
) -> bool {
- matches!(key.code, KeyCode::Char('v' | 'V'))
- && (key.modifiers.contains(KeyModifiers::CONTROL)
- || macos && key.modifiers.contains(KeyModifiers::SUPER))
+ key.generated_text.as_deref().is_none_or(str::is_empty)
+ && matches!(key.code, KeyCode::Char('v' | 'V'))
+ && (key.modifiers.difference(KeyModifiers::SHIFT) == KeyModifiers::CONTROL
+ || macos && key.modifiers.difference(KeyModifiers::SHIFT) == KeyModifiers::SUPER)
}
fn is_modal_paste_shortcut(key: &crate::input::TerminalKey) -> bool {
@@ -444,12 +445,14 @@ impl ClientShellState {
{
return false;
}
- if self
- .copy_mode
- .as_ref()
- .is_some_and(|copy_mode| copy_mode.search_prompt.is_some())
+ if self.mode == ClientShellMode::Copy
+ && self.overlay.is_none()
+ && self
+ .copy_mode
+ .as_ref()
+ .is_some_and(|copy_mode| copy_mode.search_prompt.is_some())
{
- return self.overlay.is_none();
+ return true;
}
matches!(
self.overlay.as_ref(),
@@ -609,7 +612,12 @@ impl ClientShellState {
None
}
ClientShellMode::Copy => {
- if crate::config::terminal_key_matches_combo(key, self.config.keybinds.prefix) {
+ if self
+ .copy_mode
+ .as_ref()
+ .is_none_or(|copy_mode| copy_mode.search_prompt.is_none())
+ && crate::config::terminal_key_matches_combo(key, self.config.keybinds.prefix)
+ {
self.mode = ClientShellMode::Prefix;
outcome.repaint = true;
} else {