This is actually a feature request,
Could we consider to add an option to hide/unhide a pane like the resize-pane -Z but inverse? The idea is to be hable to open a temporal panel and keep the history information. (Useful for example when working with an editor and want to compile or debug the current code temporarily, and go back and forth)
-
I tried something like resize-pane -t 2:0.1 -y 0 but it keeps one line of the target pane, so it not really hiden.
-
Then I have a bash script like this:
_split() {
local wid=$(tmux display-message -p '#{window_id}')
local toggledid="$(tmux show-options -wv @toggleid)"
local stack=":1000"
# var is set session exists
if [[ ! -z "${toggledid}" ]] && $(tmux has-session -t $toggledid); then
local toggledwid=$(tmux display-message -p -t ${toggledid} '#{window_id}')
if [[ "${toggledwid}" == "${wid}" ]]; then
# Panel exists and is visible.. so hide it
if $(tmux has-session -t "${stack}"); then
# The window stack already exists, so append
tmux join-pane -dv -s "${toggledid}" -t "${stack}.bottom"
else
# The window 100 does not exists, so break (to create)
tmux break-pane -d -n "stack" -s "${toggledid}" -t "${stack}" \;\
set -w -t "${stack}" window-status-current-format '#[bg=red,fg=colour15,bold] #W ' \;\
set -w -t "${stack}" window-style bg=blue \;\
set -w -t "${stack}" window-active-style bg=blue \;\
set -w -t "${stack}" pane-border-status top
fi
else
# The pane exists in other window so, get it back
tmux join-pane -v -l 10 -s "${toggledid}" -t ".bottom"
fi
else
# The pane does not exist, so create one and it gets active
tmux split-window -v -c '#{pane_current_path}' -l 10 -t ".bottom" \;\
set -wF -q @toggleid '#{pane_id}'
fi
}
That goes around the limitation a bit, but it is very limited and sometimes conflicts with next-window or swap-window.
So far I see several possible solutions here:
- Allow negative values for windows, meaning that any value below
base-index is considered like disabled but still local to this section. This may work but has a side effect of keeping session fully hidden, so maybe requires extra modifications...
- Really hide the pane somehow
(looking at the code it may be something like what zoom-window does but calling:
wp1->saved_layout_cell = wp1->layout_cell;
wp1->layout_cell = NULL;
But applied for a single pane.
3. Allow zero sizes in the resize-pane command so the panel will be here but not visible.
4. Implement a sort of toggle pane inherent to every window that can be hidden like the status-bar.
Does it makes sence?
Best,
Ergus
This is actually a feature request,
Could we consider to add an option to hide/unhide a pane like the
resize-pane -Zbut inverse? The idea is to be hable to open a temporal panel and keep the history information. (Useful for example when working with an editor and want to compile or debug the current code temporarily, and go back and forth)I tried something like
resize-pane -t 2:0.1 -y 0but it keeps one line of the target pane, so it not really hiden.Then I have a bash script like this:
That goes around the limitation a bit, but it is very limited and sometimes conflicts with
next-windoworswap-window.So far I see several possible solutions here:
base-indexis considered likedisabledbut still local to this section. This may work but has a side effect of keeping session fully hidden, so maybe requires extra modifications...(looking at the code it may be something like what zoom-window does but calling:
But applied for a single pane.
3. Allow zero sizes in the
resize-panecommand so the panel will be here but not visible.4. Implement a sort of toggle pane inherent to every window that can be hidden like the
status-bar.Does it makes sence?
Best,
Ergus