[PATCH] copy client/session environment to local environment on session creation

2013-12-05 Thread Matthias Lederhofer
This changes the way environment variables are handled: - a new session populates the local environment from the current client/session/server process (in case the config creates a session) - the global environment is empty by default - variables in the global environment override variables in th

Re: [PATCH] cmd_string_parse: use session environment if available

2013-11-29 Thread Matthias Lederhofer
Just found a problem: sourcing the tmux configuration expands the environment variables, too, and I don't see any way that allows escaping. That means ':new-window -c "$PWD"' on the prompt works but binding the same will resolve $PWD when parsing the config, not when pressing the keys. Any recommen

[PATCH] cmd_string_parse: use session environment if available

2013-11-28 Thread Matthias Lederhofer
This allows to use environment variables from the current session in command strings, e.g. to create a new window starting in $PWD. --- cfg.c|2 +- cmd-command-prompt.c |3 ++- cmd-confirm-before.c |3 ++- cmd-if-shell.c |3 ++- cmd-string.c | 38 +

Re: support for version blocks in tmux.conf

2012-02-21 Thread Matthias Lederhofer
Maybe you could use a shell script wrapper around tmux to run `tmux -f ~/.tmux-1.6.conf` and `tmux -f ~/.tmux-1.5.conf`? These files could include a comman .tmux.conf too to keep the version specific files small. -- Keep

Re: BUG: double width characters cause previous character to be lost

2012-01-12 Thread Matthias Lederhofer
Nicholas Marriott wrote: > Try this please, see if it fixes your problem and if you see any ill > effects: This fixes the problem for my test case. -- RSA(R) Conference 2012 Mar 27 - Feb 2 Save $400 by Jan. 27 Register n

Re: [PATCH] New option to get cwd of new windows from active window

2011-12-19 Thread Matthias Lederhofer
Romain Francoise wrote: > Hi Matthias, > > Matthias Lederhofer writes: > > > Is it easily possible to disable this feature for new sessions, i.e. by > > putting something in the tmux.conf? > > I'm not sure what you're asking. If you want to disable t

Re: [PATCH] New option to get cwd of new windows from active window

2011-12-12 Thread Matthias Lederhofer
Nicholas Marriott wrote: > Thanks for this. The OpenBSD kernel bits are in so I've applied your > diff with some minor tweaks and the required bits for osdep-openbsd.c. I really like this feature, currently I'm using a shell function to change the directory and additionally set the default-path.

Re: BUG: double width characters cause previous character to be lost

2011-12-12 Thread Matthias Lederhofer
Nicholas Marriott wrote: > uxterm rather. uxterm does actually not display the character, but displays a double width box instead. So I'm trying with this. Without tmux: the double width character is lost (i.e. only one line ending in "bar "). With tmux: the double width character and the "r" i

Re: BUG: double width characters cause previous character to be lost

2011-12-11 Thread Matthias Lederhofer
Nicholas Marriott wrote: > please send a file with the problem output since your email does not > include the actual UTF-8 Just take any double width character, I used \u300a as an example. File attached for 80 column terminal.

BUG: double width characters cause previous character to be lost

2011-12-11 Thread Matthias Lederhofer
Hi, I just noticed the following bug when playing around with double width characters: When using an urxvt terminal with width of 80 the following command prints "bar" on one line and the double width character on the next line: printf "%79s《\n" bar In tmux the same produces only "ba" on the

Re: [PATCH] New option to get cwd of new windows from active window

2011-12-06 Thread Matthias Lederhofer
Romain Francoise wrote: > +Set the default working directory for new processes. If empty (the > +default), the working directory is determined dynamically from the > +calling context: when called from keys or the command prompt the working > +directory of the process living in the active window is

Re: [PATCH] honor and export $PWD

2011-12-06 Thread Matthias Lederhofer
Nicholas Marriott wrote: > If you start PWD with it already in the environment, it is marked as > exported - this is the same as any other variable: Ah, ok. Anyway it shows that ksh uses $PWD as any other shell, even though it doesn't export it by default. > For your use, you want to be able to

Re: [PATCH] honor and export $PWD

2011-12-05 Thread Matthias Lederhofer
Nicholas Marriott wrote: > Well, not necessarily, ksh for example does not export PWD. I could not verify this (on openbsd): matled@openbsd:~% ksh $ cd /tmp/b $ env |grep ^PWD /tmp/b $ sh -c pwd /tmp/b $ env -i sh -c pwd /tmp/a > > What do you mean by the last tw

Re: [PATCH] honor and export $PWD

2011-12-05 Thread Matthias Lederhofer
Nicholas Marriott wrote: > I'm not really convinced by all the PWD talk, the canonical way to find > the current working directory is to call getcwd(). Not to use PWD, that > is just a shell convenience. I don't think applications should ever need > to check PWD rather than calling getcwd(). They

Re: [PATCH] honor and export $PWD

2011-12-03 Thread Matthias Lederhofer
Nicholas Marriott wrote: > Hmm. As far as I can see xterm doesn't set PWD, how come xterm doesn't > have this problem? > > If you make sure your shell exports PWD and add it to > update-environment, tmux will set it in the environment. Does that not > that work? It might be easier to just add PWD

[PATCH] honor and export $PWD

2011-12-01 Thread Matthias Lederhofer
Tmux does currently not set $PWD when creating a new window. This makes it impossible for the shell to figure out the path specified by the user, if it contains symlinks. Example: $ cd /tmp $ mkdir a $ ln -s a b $ cd b $ pwd /tmp/b $ tmux In tmux: $ pwd /tmp

home/end in command prompt

2011-11-27 Thread Matthias Lederhofer
Hi, I'd like to suggest that the home and end keys move the cursor to start of line and end of line as usual in command prompt mode. --- mode-key.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/mode-key.c b/mode-key.c index e45f1c6..140f004 100644 --- a/mode-key.c +

set-titles not working with urxvt

2011-11-26 Thread Matthias Lederhofer
Hi, tmux does not set the title for me when using urxvt. It does work in xterm. I'm using: - Debian squeeze 64 Bit - rxvt-unicode (urxvt) v9.07 - released: 2009-12-27 (TERM=rxvt-unicode) - XTerm(261) (TERM=xterm) I've created a new user without any configuration files to verify that the proble