mirror of
https://github.com/tmux-plugins/tmux-logging.git
synced 2026-09-10 07:16:28 -04:00
Simplify get/set logging variable
Use a pane option variable, and remove unnecessary script variables.
This commit is contained in:
parent
6455c71f56
commit
d99a25a87e
|
|
@ -17,22 +17,13 @@ stop_pipe_pane() {
|
|||
display_message "Ended logging to $logging_full_filename"
|
||||
}
|
||||
|
||||
# returns a string unique to current pane
|
||||
pane_unique_id() {
|
||||
tmux display-message -p "#{session_name}_#{window_index}_#{pane_index}"
|
||||
}
|
||||
|
||||
# saving 'logging' 'not logging' status in a variable unique to pane
|
||||
set_logging_variable() {
|
||||
local value="$1"
|
||||
local pane_unique_id="$(pane_unique_id)"
|
||||
tmux set-option -gq "@${pane_unique_id}" "$value"
|
||||
tmux set-option -pq @logging-variable "$1"
|
||||
}
|
||||
|
||||
get_logging_variable() {
|
||||
local pane_unique_id="$(pane_unique_id)"
|
||||
local current_pane_logging="$(get_tmux_option "@${pane_unique_id}" "not logging")"
|
||||
echo $current_pane_logging
|
||||
tmux show-option -pqv @logging-variable
|
||||
}
|
||||
|
||||
# this function checks if logging is happening for the current pane
|
||||
|
|
|
|||
Loading…
Reference in a new issue