1

I am trying to get help from someone, so I want to record my screen to be able to later review what happened. Formerly, I have used ssh with tee like ssh user@server | tee recfile and the recording works fine. Even when I use byobu on the server, everything is recorded using that simple pipe.

But when I pipe byobu itself to tee, the file will contain pretty nothing. I have used both byobu | tee recfile and byobu |& tee recfile. In both cases, byobu starts and works well, but the record file will only contain a few lines not related to the things happened in byobu session.

And byobu uses tmux. I have tried to pipe tmux to tee as well, and the output file only contained [exited].

My question is how tmux writes to the screen? It seems that it does not use standard output or standard error, as if it did, tee could work recording the screen. Is there a way to tell tmux to write to the standard output or standard error? Or is there another way to redirect the output to tee?


Edit: I checked that screen | tee recfile and screen |& tee recfile will produce an empty file. Also, bash | tee recfile will only redirect the output of executed commands to the file (user@name:~$'s and the input commands are not in there). bash |& tee recfile will do likewise, except that the prompt of the bash (user@name:~$) is not displayed at all.

Shayan Toqraee
  • 735
  • 8
  • 18
  • 3
    Have you tried to use `script` to record your session? – gniourf_gniourf Jan 02 '17 at 10:33
  • `tmux` use buffers, so you can use [this workaround](https://ricochen.wordpress.com/2011/04/07/capture-tmux-output-the-much-less-painful-way/) to save your tmux session to a file. – F4240 Jan 02 '17 at 11:04
  • You could use the tool `recordmydesktop` which has a gtk GUI as well that you can use to select specific windows to record. – Yokai Jan 02 '17 at 13:47
  • @Yokai I don't want a video file as the output, I want a text file. This can be understood from the question. – Shayan Toqraee Jan 02 '17 at 21:54
  • You said in your question, and I quote, `I want to record my screen to be able to later review what happened.` so I provided a method of doing that. This can be understood by having reading comprehension of your own question. – Yokai Jan 03 '17 at 11:45
  • Please don't... I have explicitly written my questions in the last paragraph. But thanks anyways. Maybe someday I come back to this page to take the name of the tool you suggested. – Shayan Toqraee Jan 03 '17 at 19:41

1 Answers1

1

As gniourf_gniourf pointed out, script solved my problem.

I also wrote a simple C++ code to playback the recorded file. Compile it with --std=c++11. (I use script -c byobu --timing=recfile.tim recfile to record and scriptout recfile recfile.tim 3 for playback.)

https://gist.github.com/Shayan-To/672c77fbf9811d769d453c8a9b43747e

Shayan Toqraee
  • 735
  • 8
  • 18