diff --git a/bot/share_client.sh.gotmpl b/bot/share_client.sh.gotmpl index cad1263..56cd4c0 100755 --- a/bot/share_client.sh.gotmpl +++ b/bot/share_client.sh.gotmpl @@ -17,6 +17,7 @@ remote_ssh_port="{{.ServerPort}}" remote_ssh_user="{{.User}}" remote_ssh_relay_port="{{.RelayPort}}" tmux_session="replbot_{{.SessionID}}_client" +tmux_config_file="/tmp/replbot_{{.SessionID}}.tmux-config" sshd_config_file="/tmp/replbot_{{.SessionID}}.client-sshd-config" sshd_hostkey_file="/tmp/replbot_{{.SessionID}}.client-sshd-hostkey" sshd_authorized_keys_file="/tmp/replbot_{{.SessionID}}.client-sshd-authorized-keys" @@ -47,7 +48,7 @@ cleanup() { if [ -n "${check_pid}" ]; then kill "${check_pid}" 2>/dev/null fi - rm -f "${sshd_config_file}" "${sshd_hostkey_file}" "${sshd_authorized_keys_file}" + rm -f "${sshd_config_file}" "${sshd_hostkey_file}" "${sshd_authorized_keys_file}" "${tmux_config_file}" clear echo "REPLbot terminal sharing session ended. You may reconnect with the same" echo "command as before. Check out https://heckel.io/replbot to learn more." @@ -55,11 +56,14 @@ cleanup() { trap cleanup EXIT # Start new tmux session -tmux set -g default-terminal "xterm-256color" # This is ugly, because it's global (-g) -tmux new-session -d -s "${tmux_session}" \ +cat > "${tmux_config_file}" <