Skip to content

Commit

Permalink
fix(rust): add default-terminal setting for Oxide
Browse files Browse the repository at this point in the history
This commit fixes issue #4268 by adding the line "set -g default-terminal "screen-256color"" to the ~/.tmux.conf file. This ensures compatibility with tmux version 3.3 or higher when running RustDedicated servers with Oxide.Rust.dll.
  • Loading branch information
dgibbs64 committed Nov 18, 2023
1 parent f80a1b6 commit b15239e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions lgsm/modules/fix_rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,23 @@ if [ -f "${serverfiles}/carbon/tools/environment.sh" ]; then
# shellcheck source=/dev/null
source "${serverfiles}/carbon/tools/environment.sh"
fi

# fix for #4268
# insert set -g default-terminal "screen-256color" into ~/.tmux.conf
if [ -f "${serverfiles}/RustDedicated_Data/Managed/Oxide.Rust.dll" ]; then
# tmux version is 3.3 or higher
tmuxvdigit="$(tmux -V | sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')"

if [ "${tmuxvdigit}" -ge "33" ]; then
if [ ! -f "${HOME}/.tmux.conf" ]; then
touch "${HOME}/.tmux.conf"
fi
if ! grep -q "set -g default-terminal \"screen-256color\"" "${HOME}/.tmux.conf"; then
fixname="tmux screen-256color"
fn_fix_msg_start
echo "set -g default-terminal \"screen-256color\"" >> "${HOME}/.tmux.conf"
fn_fix_msg_end

fi
fi
fi

0 comments on commit b15239e

Please sign in to comment.