Tmux tickets

Lots of different concert tickets with some overlapping

Problems

Like many engineers, I have a support shift. When doing so, much of the work is based around tickets. At the same time, it’s very useful to understand what changes are made for each ticket. This helps for future reference and knowledge sharing as well as understanding changes made if anything goes sideways. The question is how to do this without making it add to the burden of support.

Solution

Tmux helps in multiple ways for this by isolating commands for a given ticket and saving the commands with output to a file. The one caveat is make sure to remove any sensitive information as part of the process.

  1. Start a new session with tmux using the command
    • tmux new -s PROJ-1234
  2. This will isolate any commands for the particular ticket
  3. It will preserve the window if it is closed as well. However it will be lost if you restart or shutdown
  4. When you are done, you can run
    • name=$(tmux display-message -p '#S') && tmux capture-pane -pS - >> ~/Desktop/${name}_commands.txt 2>&1
  5. This will append the output from the session to a file prefixed with the session name.
  6. Make sure to remove any passwords, Personal Identifiable Information(PII) or other sensitive information prior to sharing it.

References

  1. Unix & Linux StackExchange: Write all tmux scrollback to a file
  2. SuperUser StackExchange: Is redirection with `>>` equivalent to `>` when target file doesn’t yet exist?
  3. SuperUser StackExchange: How do I know current tmux session name, by running tmux command