Comment by imankulov
1 day ago
I left tmux for zellij after several unsuccessful attempts to get Shift+Enter working.
Was quite impressed initially and invested weeks in building new muscle memory, but somehow Zellij crashed with panic more than once, leaving all my processes orphaned. Decided to go back to tmux, and found a simple fix for my Shift+Enter issue.
In case anyone is looking for it, the fix is "bind-key -T root S-Enter send-keys C-j" borrowed from https://github.com/anthropics/claude-code/issues/6072.
I ended up with this: bind -n S-Enter send-keys Escape '[13;2u'
pi.dev keeps complaining that "set -s extended-keys on" is missing, but it still works :D
> In case anyone is looking for it, the fix is "bind-key -T root S-Enter send-keys C-j"
I was looking, thank you!
Yeah or just use Ctrl + J
Is it possible for a multiplexer process to die, but in such a bad way that its child processes continue to run?
I’ve been relying on the fact that in the worst-case scenario (if a pane hangs and tmux session becomes unresponsive) I can just kill tmux server and not have to hunt down and kill dozens of individual processes afterwards.
A `kill -9` will cause many a process to die and give no chance to cleanup any child processes. Some percentage of users continue to use `kill -9` by default, which may result in a mess of a process tree. Otherwise if the crash is bad enough that cleanup code cannot run (maybe it's being run on OpenBSD and an incompetent programmer didn't check the return value of a malloc and for some reason the kernel now nukes the process) then there may be orphan children. There may also be sporadic failures to cleanup if the crash, maybe, causes the whole process to exit before the cleanup code in some other thread can run. System load average may also influence how things maybe go sideways.
That depends on how the children were spawned, no? prctl(PR_SET_PDEATHSIG, SIGTERM); or similar will fix this.
TIL. I didn’t know it’s the responsibility of the parent, thought OS automatically handles child processes.
2 replies →
Interesting, for me `shift+enter` hasnt worked, but `option+enter` does give me new lines in Claude Code's promptbox inside tmux on MacOS.
Interesting. I’ve just been using ‘\ + enter’
I just use Ctrl-g to open the prompt in emacs.
1 reply →
Or if you want to avoid having to set new bindings, do '\ + enter' (which escapes the enter).
What does shift-enter do for you?
Maybe some keybind in a software. Another mentions Claude code, so it may be used to enter new line where enter is bound to send the prompt.
Terminal programs don’t see key events. It’s all text. I just checked st (suckless) code and the RETURN key will send “\r” aka carriage return. Control+j is “\n” or line feed.