Skip to content

Commit

Permalink
Use tmux as default terminal if tmux is installed.w
Browse files Browse the repository at this point in the history
  • Loading branch information
kernel-cyrus committed May 15, 2024
1 parent c4cca07 commit f6df997
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions start-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ DTB=$(realpath ./prebuilts/dts/lightbox.dtb)
CMDLINE=""
DEBUGGER="gdb"
SHARE_FOLDER=$(realpath ./host-share)
TERMINAL="gnome"

if type tmux >/dev/null 2>&1; then
TERMINAL="tmux"
else
TERMINAL="gnome"
fi

PARAMS="$@"

for i in "$@"; do
Expand Down Expand Up @@ -126,10 +132,10 @@ elif [ $TERMINAL == "tmux" ]; then
tmux kill-session -t lightbox
tmux new-session -d -s lightbox "bash"
tmux send-keys -t lightbox "cd $DIR" C-m
tmux send-keys -t lightbox "source ./start-kernel.sh ${PARAMS/tmux/cli-qemu}" C-m
tmux send-keys -t lightbox "source ./start-kernel.sh ${PARAMS/tmux/cli-qemu} --terminal=cli-qemu" C-m
tmux split-window -h "bash"
tmux send-keys -t lightbox "cd $DIR" C-m
tmux send-keys -t lightbox "source ./start-kernel.sh ${PARAMS/tmux/cli-gdb}" C-m
tmux send-keys -t lightbox "source ./start-kernel.sh ${PARAMS/tmux/cli-gdb} --terminal=cli-gdb" C-m
tmux attach-session -d -t lightbox
tmux kill-session -t lightbox
return 0
Expand Down

0 comments on commit f6df997

Please sign in to comment.