On Sun, Apr 06, 2014 at 10:34:27AM +0200, vlamy wrote:
>    Hi !
> 
>    I may missunderstood your needs, but what about using the "list-panes"
>    command to get the current session name ?
> 
>    > tmux list-panes -F '#{session_name}'
> 
>    By instance :
> 
>    ~/.zshrc :
> 
>    > zshexit() {
>    >  var=`tmux list-panes -F '#{session_name}'`
>    >  echo "zsh exit from $var" > ~/tmux_exit
>    >}

This doesn't work because the zshexit function is defined in the outer
shell and there $TMUX is not set.

> urxvt -> zsh -> tmux -> zsh

On Sat, Apr 05, 2014 at 09:51:10PM +0100, Nicholas Marriott wrote:
> Well we don't have a client_pid format but perhaps you can get the
> tty with ps then do eg tmux lsc -F "#{client_tty} #{session_id}"|grep
> whatevertty If you always detach with key bindings could also
> consider this instead: set -g destroy-unattached on bind d set
> destroy-unattached off\; detach
The destroy-unattached option seems to destroy the original session
instead of the current session.

> urxvt -> zsh -X [tmux -> zsh]
>          ^       dead
>          \--- zshexit called here

I can get the id of an attached session by using your method, but the
tmux client is already killed when zshexit is called, so this may not
be as easy as I had envisioned it.

-- 
Best Regards,
Peter Kasza

http://www.iit.uni-miskolc.hu/~kasza1
mr.sch...@gmail.com

()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Attachment: pgpdhkJD30js7.pgp
Description: PGP signature

------------------------------------------------------------------------------
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to