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

2011-12-13 Thread Romain Francoise
Hi Matthias, Matthias Lederhofer mat...@gmx.net 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 the feature for any sessions created in your config file, then you can

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

2011-12-12 Thread Matthias Lederhofer
Nicholas Marriott nicholas.marri...@gmail.com 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

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

2011-12-09 Thread Nicholas Marriott
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. Anyone wants to do AIX, Darwin, DFLY, HP/UX, or NetBSD send the code :-). On Tue, Dec 06, 2011 at 07:35:18PM +0100, Romain Francoise wrote: Nicholas

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

2011-12-07 Thread Nicholas Marriott
This looks good apart from minor things, I'll take a better look later today hopefully. Thanks On Tue, Dec 06, 2011 at 07:35:18PM +0100, Romain Francoise wrote: Nicholas Marriott nicholas.marri...@gmail.com writes: Ok, so OpenBSD should have a way to do this soon, either a new

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

2011-12-06 Thread Romain Francoise
Nicholas Marriott nicholas.marri...@gmail.com writes: Ok, so OpenBSD should have a way to do this soon, either a new second-level sysctl KERN_PROC_CWD or a new third-level under KERN_PROC_ARGS. Don't worry about that though, let's move forward with your diff and I'll add OpenBSD when my code

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

2011-12-06 Thread Romain Francoise
marcel partap mpar...@gmx.net writes: ..just for reference, from konsole/src/ProcessInfo.cpp, includes omitted: [...] Thanks, that was useful. -- Romain Francoise rfranco...@debian.org http://people.debian.org/~rfrancoise/

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

2011-12-05 Thread marcel partap
..just for reference, from konsole/src/ProcessInfo.cpp, includes omitted: virtual bool LinuxProcessInfo::readCurrentDir(int pid) { QFileInfo info( QString(/proc/%1/cwd).arg(pid) ); const bool readable = info.isReadable(); if ( readable info.isSymLink() )

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

2011-12-05 Thread Nicholas Marriott
Cool. So basically we need to implement KERN_PROC_CWD on OpenBSD, although I don't think I would do it the way DragonFly does, I would probably add a new level 3 sysctl like KERN_PROC_ARGS. Lemme see if I have time to look at it this week. On Mon, Dec 05, 2011 at 10:08:55AM +0100, marcel partap

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

2011-12-04 Thread Romain Francoise
I think I spoke too fast. KERN_FILE_BYPID only gives you the inode number of the cwd and the mountpoint of the filesystem where it's located. Finding the name of the directory from that requires walking the entire filesystem, which is obviously out of the question... So I guess we're back to

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

2011-12-04 Thread Romain Francoise
Nicholas Marriott nicholas.marri...@gmail.com writes: Can we do this on ANY platform apart from Linux? Solaris, with procfs. That's about it, I think. -- Romain Francoise rfranco...@debian.org http://people.debian.org/~rfrancoise/

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

2011-12-04 Thread George Nachman
On Sun, Dec 04, 2011 at 03:58:36PM +0100, Romain Francoise wrote: I think I spoke too fast. KERN_FILE_BYPID only gives you the inode number of the cwd and the mountpoint of the filesystem where it's located. Hm. That sucks... looks like getcwd() works by walking each vnode on the way up

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

2011-12-01 Thread Romain Francoise
I figured this would be controversial... First some context: this was originally filed a wishlist request in the Debian BTS. I replied that the only way to keep the cwd is to use the client, and that achieving this from keys would involve non-portable ways of getting the working directory and so

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

2011-12-01 Thread Nicholas Marriott
Yeah it has to work on OpenBSD and preferably FreeBSD too.I think you can probably use sysctl KERN_FILE, KERN_FILE_BYPID and look for KERN_FILE_CDIR in fd_fd on OpenBSD at least. I don't think we need a new option, why not make default-path default to and override the automatic inheriting if

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

2011-11-30 Thread Romain Francoise
Hi, This patch adds a new session option 'inherit-default-path' and the associated machinery to create new windows/panes in the same working directory as the active window instead of using the value of default-path. It affects only windows created from keys or the command prompt. Note that only

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

2011-11-30 Thread Thomas Adam
On Wed, Nov 30, 2011 at 09:48:31PM +0100, Romain Francoise wrote: Hi, This patch adds a new session option 'inherit-default-path' and the associated machinery to create new windows/panes in the same working directory as the active window instead of using the value of default-path. It

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

2011-11-30 Thread Romain Francoise
Thomas Adam tho...@xteddy.org writes: Why, when this is in the tmux FAQ? The solution in the FAQ is ugly. -- Romain Francoise rfranco...@debian.org http://people.debian.org/~rfrancoise/ -- All the data continuously

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

2011-11-30 Thread Nicholas Marriott
I'm genuinely not delighted about more OS-dependent code. Is there no portable solution to this? Even if it isn't quite as good. Otherwise, what's the use case here? I love that you sent code but how inconvenient is it to have more OS-dependent code verses the actual issue? And how inconvenient