From 85eeb0d39b40ed659751f082274383d8492823b8 Mon Sep 17 00:00:00 2001 From: Zach Dykstra Date: Sat, 28 Mar 2020 12:51:23 -0500 Subject: [PATCH] Make the debug log a bit more readable --- README.md | 1 + tmuxc | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ccd83a..9f6a2be 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,7 @@ If the default option is acceptable, you do not need to define it again in a con * `on_connect (default[])`: When operating in single-window-mode, define an array of tmux commands to be sent to the cloned session to which you are attached. This option is only executed when `swm` is true. * `persist (default 10s)`: Set the SSH `ControlPersist` option for control master connections. * `prettyps (default 1)`: Control the process name on the command line, reducing it to `binaryname session@host`. +* `poe (default none)`: Enable purge-on-exit for `ephemeral` or `all` sessions. This will execute a `kill-session` against the session on exit. * `reconnect (default 1)`: Attempt to reconnect to the remote host and re-open windows if SSH drops. This is useful for laptops that are suspended frequently. * `selector (default: rofi -dmenu -i)`: Define the menu command, used for picking a session / session action. * `skipnw (default 0)`: Do not launch a new terminal when a new window is created in tmux. diff --git a/tmuxc b/tmuxc index a7a2984..5436f78 100755 --- a/tmuxc +++ b/tmuxc @@ -551,11 +551,11 @@ END { or ( $config->{ephemeral} and $config->{poe} eq "ephemeral" ) ) { my @cmd = buildCommand( $host, [ $config->{tmux_bin}, qw(kill-session -t), $config->{session}, ] ); - Log( LOG_DEBUG, \@cmd ); + Log( LOG_DEBUG, "Killing session $config->{session}" ); qx(@cmd); @cmd = buildCommand( $host, [ $config->{tmux_bin}, qw(kill-session -t), $config->{control}, ] ); - Log( LOG_DEBUG, \@cmd ); + Log( LOG_DEBUG, "Killing control session $config->{control}" ); qx(@cmd); } @@ -1538,6 +1538,10 @@ Open up a menu listing sessions from the .tmuxc.conf file that aren't running. Open up a menu listing control options. If one instance is running, the command is executed on that instance. If multiple are running, prompt the running sessions. +=item B<--poe|P> + +Enable purge-on-exit for sessions of type 'none', 'ephemeral' or 'all'. This executes a I against the session on tmuxc exit. + =item B<--singlemenu|M> Open up a menu listing control options. The options take the form of session@host % , and are shown as a single-depth menu. Smart pagers (rofi, bemenu, etc) allow you to type partial words in any order to narrow down the option to execute.