So when i ssh into a remote server i use 'screen -R myscreen' to prevent any running scripts/processes from being interrupted when the ssh connection disconnects, for whatever reason (bad wifi, etc).
However, when starting screen, iTerm2's shell integration doesn't work anymore.
Is there any workaround for this?
fyi the solution i found is:
instead of 'screen' use 'tmux', by executing tmux -CC
to open a tmux session (and using tmux -CC attach
to re-attach after a disconnection.)
This is also described here.
To make iTerm2 shell integration work in tmux, modify ~/.iterm2_shell_integration.bash
and remove this part of the first line:
"$TERM" != screen
So this
if [[ "$TERM" != screen && "$ITERM_SHELL_INTEGRATION_INSTALLED" = "" && "$-" == *i* ]]; then
becomes:
if [[ "$ITERM_SHELL_INTEGRATION_INSTALLED" = "" && "$-" == *i* ]]; then
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With