tmux: use send-keys -l for literal text input
Without -l, tmux send-keys treats spaces as key-name separators, so multi-word messages like "This is your time" get split into individual unrecognized key names instead of being typed as text. This caused idle nudges to arrive as blank messages.
This commit is contained in:
parent
55fdc3dad7
commit
95baba54c0
1 changed files with 6 additions and 2 deletions
|
|
@ -51,8 +51,12 @@ pub fn send_prompt(pane: &str, msg: &str) -> bool {
|
||||||
}
|
}
|
||||||
thread::sleep(Duration::from_secs(1));
|
thread::sleep(Duration::from_secs(1));
|
||||||
|
|
||||||
// Type the message
|
// Type the message (literal mode so spaces aren't key separators)
|
||||||
if !send(&[msg]) {
|
let ok = Command::new("tmux")
|
||||||
|
.args(["send-keys", "-t", pane, "-l", msg])
|
||||||
|
.output()
|
||||||
|
.is_ok();
|
||||||
|
if !ok {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
thread::sleep(Duration::from_millis(500));
|
thread::sleep(Duration::from_millis(500));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue