[tools] Rearrange qemu tmux windows on smaller displays
So I can still use ./qemu.sh --debug on my laptop.
This commit is contained in:
21
qemu.sh
21
qemu.sh
@@ -72,11 +72,28 @@ if ! ninja -C "${build}"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $TMUX ]]; then
|
if [[ -n $TMUX ]]; then
|
||||||
|
cols=$(tput cols)
|
||||||
|
|
||||||
if [[ -n $debug ]]; then
|
if [[ -n $debug ]]; then
|
||||||
tmux split-window -h -l 270 "sleep 1; nc -t localhost 45455 | tee debugcon.log"
|
log_width=100
|
||||||
tmux split-window -h -l 160 "gdb ${debugtarget}"
|
gdb_width=$(($cols - 2 * $log_width))
|
||||||
|
|
||||||
|
debugcon_cmd="sleep 1; nc -t localhost 45455 | tee debugcon.log"
|
||||||
|
|
||||||
|
if (($gdb_width < 150)); then
|
||||||
|
stack=1
|
||||||
|
gdb_width=$(($cols - $log_width))
|
||||||
|
tmux split-window -h -l $gdb_width "gdb ${debugtarget}"
|
||||||
|
tmux select-pane -t .left
|
||||||
|
tmux split-window -v "$debugcon_cmd"
|
||||||
|
tmux select-pane -t .right
|
||||||
|
else
|
||||||
|
tmux split-window -h -l $(($log_width + $gdb_width)) "$debugcon_cmd"
|
||||||
|
tmux split-window -h -l $gdb_width "gdb ${debugtarget}"
|
||||||
tmux select-pane -t .left
|
tmux select-pane -t .left
|
||||||
tmux select-pane -t .right
|
tmux select-pane -t .right
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
tmux split-window -h -l 100 "sleep 1; telnet localhost 45455"
|
tmux split-window -h -l 100 "sleep 1; telnet localhost 45455"
|
||||||
tmux last-pane
|
tmux last-pane
|
||||||
|
|||||||
Reference in New Issue
Block a user