From f6df99772cb872c8bb1561363087456465f71ef9 Mon Sep 17 00:00:00 2001 From: Cyrus Huang Date: Wed, 15 May 2024 19:59:10 +0800 Subject: [PATCH] Use tmux as default terminal if tmux is installed.w --- start-kernel.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/start-kernel.sh b/start-kernel.sh index 35dcc0c..d986045 100755 --- a/start-kernel.sh +++ b/start-kernel.sh @@ -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 @@ -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