Skip to content

Commit

Permalink
Change terminal to to xterm-256color
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Heckel committed Sep 22, 2021
1 parent 694f064 commit b60bd35
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bot/share_client.sh.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -47,19 +48,22 @@ 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."
}
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}" <<TMUXCONF
set-option default-terminal xterm-256color
TMUXCONF
tmux -f "${tmux_config_file}" new-session -d -s "${tmux_session}" \
"echo 'Your session is now shared in your chat.'; echo 'This is a tmux session. The prefix key is Ctrl+I.'; echo; $SHELL"
tmux set-option -t "${tmux_session}" status off
tmux set-option -t "${tmux_session}" prefix C-i
tmux set-option -t "${tmux_session}" mouse on
# tmux set-option -t "${tmux_session}" pane-active-border-style "fg=#000000,bg=#000000"
# tmux set-option -t "${tmux_session}" pane-border-style "fg=#000000,bg=#000000"

Expand Down

0 comments on commit b60bd35

Please sign in to comment.