Skip to content

Commit d99a25a

Browse files
author
Phil Hindman
committed
Simplify get/set logging variable
Use a pane option variable, and remove unnecessary script variables.
1 parent 6455c71 commit d99a25a

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

scripts/toggle_logging.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,13 @@ stop_pipe_pane() {
1717
display_message "Ended logging to $logging_full_filename"
1818
}
1919

20-
# returns a string unique to current pane
21-
pane_unique_id() {
22-
tmux display-message -p "#{session_name}_#{window_index}_#{pane_index}"
23-
}
24-
2520
# saving 'logging' 'not logging' status in a variable unique to pane
2621
set_logging_variable() {
27-
local value="$1"
28-
local pane_unique_id="$(pane_unique_id)"
29-
tmux set-option -gq "@${pane_unique_id}" "$value"
22+
tmux set-option -pq @logging-variable "$1"
3023
}
3124

3225
get_logging_variable() {
33-
local pane_unique_id="$(pane_unique_id)"
34-
local current_pane_logging="$(get_tmux_option "@${pane_unique_id}" "not logging")"
35-
echo $current_pane_logging
26+
tmux show-option -pqv @logging-variable
3627
}
3728

3829
# this function checks if logging is happening for the current pane

0 commit comments

Comments
 (0)