I've grown tired of trying to get tmux scollback working with iTerm2 and my keymapping of choice.  Having realized that I can dump buffers into text files, I find that this is no longer necessary, or even particularly desirable.  Currently my binding to achieve this effect is as follows:bind B capture-pane -S -999000 \; save-buffer ~/.tmux/buffers/filenameOf course, this arrangement leads to me clobbering filename every time I dump a buffer.  What would be much niftier is a buffer-naming format of $PANE-NAME_YYYY-MM-DD_HH:MM:SS (where the date and time are current on-dump).I've looked through tmux(1) and while it notes some variables that are available, including times related to client activity, I was unable to successfully expand them into the filename in my .tmux.conf, and I don't think that this is really what I'm looking for anyway.I'm fairly certain that I'm missing something obvious, but at this point I've spent so much time looking for it that I'm not sure I'd recognize it if I did see it.  Any help here would be much appreciated.
Naming buffer exports dynamically in tmux
tmux
You can achieve this by making tmux run these as shell commands, with the run-shell (aliased to run) instruction and some additional quoting:bind B run tmux capture-pane -S -999000; tmux save-buffer ~/.tmux/buffers/\$(date +%d%m%y)\This will save your buffer output as ~/.tmux/buffers/240115. You can obviously customize the date command to deliver the degree of granularity that you require.Regarding using the pane_title: if you read the FORMATS section of the man page, it states:Certain commands accept the -F flag with a format argument.Unfortunately, save-buffer is not one of those commands.You can, however, hack around it using the list-panes command to retrieve the current window name:bind B run tmux capture-pane -S -999000; tmux save-buffer ~/.tmux/buffers/\$(tmux list-panes -F '#{window_name}')\_\$(date +%d%m%y)\which will return, for example,: ~/.tmux/buffers/zsh_240115.