Skip to content

Use multiple terminals

Andrea Cardaci edited this page Dec 12, 2019 · 1 revision

The whole dashboard or individual modules can be displayed in a different terminal, this is useful since the vertical space is often limited, plus in this way the GDB prompt and program I/O are separated from the dashboard.

The -output command applies to both the dashboard and individual modules and allows to specify the output file of each component. For example to display the dashboard in another terminal and the assembly and source modules in yet other terminals on their own use:

dashboard -output /dev/pts/1
dashboard assembly -output /dev/pts/3
dashboard source -output /dev/pts/2

Note that assembly and source modules can use the whole terminal height dynamically in this case, just use:

dashboard assembly -style height 0
dashboard source -style height 0

To identify the TTY file name associated with terminal use the tty system command, those entries are often in the format /dev/pts/<n>.

It is possible to somewhat automate all this, for example the following shell function is a tmux integration that starts GDB in a split layout where the prompt is on the left pane and the dashboard is on the right one:

gdb-tmux() {
    local id="$(tmux split-pane -hPF "#D" "tail -f /dev/null")"
    tmux last-pane
    local tty="$(tmux display-message -p -t "$id" '#{pane_tty}')"
    gdb -ex "dashboard -output $tty" "$@"
    tmux kill-pane -t "$id"
}