tmux-plugins / tmux-logging

Easy logging and screen capturing for Tmux.
MIT License
1.03k stars 113 forks source link

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

Open bedge opened 5 years ago

bedge commented 5 years ago

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


- 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.
bruno- commented 5 years ago

Hi,

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

bedge commented 5 years ago

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 commented 5 years ago

Submitted pull request to address.