There is a race between you creating the windows and your shell running the
profile, since you are creating the windows in such quick succession in the
config file it is almost always hit.

The easiest thing to do is to use $TMUX_PANE for the target (-t) to
display-message in the shell profile.

On 8 January 2018 at 16:36, Steffen Nurpmeso <stef...@sdaoden.eu> wrote:

> Hello.
>
> I am using per shell instance history files per default, à la
>
>   i=`tty`
>   x=`basename "${i}"`
>   HISTFILE="${HOME}/traffic/.sh_hist_${x}"
>
> and such; i thought i use tmux display-message -p to get
> completely reproducable behaviour inside of tmux, i.e., by doing
>
>   elif [ -n "${TMUX_PANE}" ] && command -v tmux >/dev/null 2>&1; then
>      i=tmux_`tmux display-message -p '#{session_name}_#{window_index}'`
>
> This works perfectly fine when creating windows via
>
>   bind-key '#' new-window -t MAUI -c~
>
> but it does not work from within this .tmux.conf
>
>   set-option -g history-limit 64000
>   new-session -s MAUI -n mail -c~
>   new-window -t MAUI -d -n accu -t 2 -c~
>   new-window -t MAUI -d -n doc -t 3 -c~
>   new-window -t MAUI -d -n tmp -t 4 -c~
>   new-window -t MAUI -d -n vms -t 5 -c~
>   set-option -g history-limit 0
>   new-window -t MAUI -d -n edit -t 1 -c~ vim -u ~/.vimrc
>   set-option -g history-limit 42000
>
> With or without -d the shells all end up with the same $HISTFILE.
> Is there anything that can be done about that?
>
> (And if i could express i wish i would ask for a -h option to
> new-window and new-session to be able to more easily define
> a history limit.)
>
> --steffen
> |
> |Der Kragenbaer,                The moon bear,
> |der holt sich munter           he cheerfully and one by one
> |einen nach dem anderen runter  wa.ks himself off
> |(By Robert Gernhardt)
>
> --
> You received this message because you are subscribed to the Google Groups
> "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tmux-users+unsubscr...@googlegroups.com.
> To post to this group, send an email to tmux-users@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tmux-users+unsubscr...@googlegroups.com.
To post to this group, send an email to tmux-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to