File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -10,25 +10,31 @@ start_pipe_pane() {
1010 local file=$( expand_tmux_format_path " ${logging_full_filename} " )
1111 " $CURRENT_DIR /start_logging.sh" " ${file} "
1212 display_message " Started logging to ${file} "
13+ set_logging_variable " logging"
1314}
1415
1516stop_pipe_pane () {
1617 tmux pipe-pane
1718 display_message " Ended logging to $logging_full_filename "
19+ unset_logging_variable
1820}
1921
2022# saving 'logging' 'not logging' status in a variable unique to pane
2123set_logging_variable () {
2224 tmux set-option -pq @logging-variable " $1 "
2325}
2426
27+ unset_logging_variable () {
28+ tmux set-option -pu @logging-variable
29+ }
30+
2531get_logging_variable () {
2632 tmux show-option -pqv @logging-variable
2733}
2834
2935# this function checks if logging is happening for the current pane
3036is_logging () {
31- if [ " $( get_logging_variable) " == " logging " ]; then
37+ if [ -n " $( get_logging_variable) " ]; then
3238 return 0
3339 else
3440 return 1
@@ -38,10 +44,8 @@ is_logging() {
3844# starts/stop logging
3945toggle_pipe_pane () {
4046 if is_logging; then
41- set_logging_variable " not logging"
4247 stop_pipe_pane
4348 else
44- set_logging_variable " logging"
4549 start_pipe_pane
4650 fi
4751}
You can’t perform that action at this time.
0 commit comments