Reputation: 44491
I have a shortcut defined to start logging a pane to a file, and another to stop logging. The shortcuts are active. These are the commands in my .tmux.conf
:
bind-key H pipe-pane "cat >>$HOME/tmux.log"
bind-key h pipe-pane
By pressing C-b ?
I am able to see the definition:
H: pipe-pane "exec cat >>/home/myuser/tmux.log"
h: pipe-pane
The idea is that C-b H
will start logging and C-b h
will stop it, for the current pane. It is clear that different panes will collide, but I am not worried about this now. I just want logging to work, and it does not. The shortcuts seem to work fine, and the file is created alright:
-rw-r--r-- 1 myuser mygroup 0 2012-04-28 11:21 tmux.log
But it always has size 0. Even after closing. Nothing, never ever, gets written to it. Any ideas on how to debug this issue?
This is the only gripe I have with tmux
compared to screen
, where logging has always been a simple task, working out of the box without any configuration needed.
Upvotes: 4
Views: 6259
Reputation: 20175
For my tmux 1.8, I only got this to work first being inside the tmux window and then hitting
[Ctrl]+[b]
[:]
and then typing:
pipe-pane -o 'cat >> ~/output.log'
It did not work when I was detached from the tmux session and tried
tmux pipe-pane -o -t sessionname:0 'cat >> ~/output.log'
# that does not work for me in tmux 1.8
Upvotes: 0
Reputation: 194
What version of tmux? Why aren't you using the -o option to pipe-pane?
If this is still producing a zero-length file, try starting tmux with -vvvv, and repeat the pipe-pane commands, and put the logs somewhere.
Upvotes: 1