tmux-logging icon indicating copy to clipboard operation
tmux-logging copied to clipboard

tmux-logging/scripts/start_logging.sh in bashrc not working

Open bedge opened this issue 7 years ago • 3 comments

https://github.com/tmux-plugins/tmux-logging/issues/28 has some shortcomings. (Unless I'm just being stupid, which is entirely possible)

  • Doesn't observe .tmux/conf settings, eg:
# https://github.com/tmux-plugins/tmux-logging/pull/20
set -g @logging-path "$HOME/log/tmux/%Y-%m-%d"
set -g @logging-filename "#{session_name}-#{window_name}-#{pane_index}.log"

  • requires $log_file already be set elsewhere, negating the logic already provided by the above config settings.

Given the key bindings:

bind-key -T prefix P run-shell /Users/bedge/.tmux/plugins/tmux-logging/scripts/toggle_logging.sh

I would expect being able to run: ~/.tmux/plugins/tmux-logging/scripts/start_logging.sh

to enable logging to the file cfg'd above, but it doesn't.

With that in my bashrc, logging is not enabled, at least not to the file I have configured. (see above) However when I run /Users/bedge/.tmux/plugins/tmux-logging/scripts/toggle_logging.sh I get a "...logging ended" message, implying some component did think it was logging.

Running it again DOES start logging to the right place. WTF am I doing wrong?

This also pops out periodically:

❯ ~/.tmux/plugins/tmux-logging/scripts/toggle_logging.sh /Users/bedge/.tmux/plugins/tmux-logging/scripts/shared.sh: line 5: [: not: binary operator expected

Great plugin, despite my whining BTW.

bedge avatar Dec 29 '18 21:12 bedge

Hi,

It seems PR #13 had a fix for the error you were getting. That one is now merged so maybe try again?

bruno- avatar Jan 07 '19 13:01 bruno-

Problem still exists. ie: run - ~/.tmux/plugins/tmux-logging/scripts/start_logging.sh

from a shell prompt, and logging is not started.

Note that: ~/.tmux/plugins/tmux-logging/scripts/toggle_logging.sh

Does work to toggle logging, but the start_logging.sh does not work from a shell.

I want to be able to trigger logging on from a script, regardless of whether it's already on or not.

❯ tmux -V tmux 2.9a

Just updated to current plugins as well (using tpm).

bedge avatar May 25 '19 14:05 bedge

Submitted pull request to address.

bedge avatar May 25 '19 16:05 bedge