:drop doesn't respect 'autochdir'?

94 views
Skip to first unread message

Peter Odding

unread,
Jul 23, 2010, 6:57:20 PM7/23/10
to vim_dev
Hi list,

I use a ~/bin/gvim script to turn graphical Vim into a single instance
program using the --remote-tab-silent command line option. This works
great except that I have set the 'autochdir' option in my ~/.vimrc and
have come to rely on it but it doesn't work with --remote-tab-silent.

The problem is that :drop doesn't seem to honor the 'autochdir' option
because when I use my ~/bin/gvim script to edit a file in an existing
Vim instance I find that :pwd prints the working directory from before
:drop was executed. I always forget about this and consequently execute
shell commands using :! in the wrong working directory...)

Is :drop supposed to ignore the 'autochdir' option or should it be
fixed? I tested with the latest Vim 7.3 and the command line gvim -u
NONE -U NONE --noplugin -N --cmd 'set acd'.

- Peter Odding

Ben Fritz

unread,
Jul 24, 2010, 9:38:29 AM7/24/10
to vim_dev
This has bothered me for quite some time on Windows XP, it's also in
Vim 7.2 and probably in Vim 7.1 as well. I never bothered tracking
down the steps to reproduce because it seemed to me that it was
intermittent when I loaded files. Is it readily reproduceable
using :drop? I use a variety of commands to load files.

I'd certainly like to see it fixed if it is not intentional for some
reason.

The workaround I found is to switch windows, tabs, or buffers, and
come back to it, and 'acd' takes effect.

Peter Odding

unread,
Jul 24, 2010, 10:17:13 AM7/24/10
to vim...@googlegroups.com
Hi Ben,

> This has bothered me for quite some time on Windows XP, it's also in
> Vim 7.2 and probably in Vim 7.1 as well. I never bothered tracking
> down the steps to reproduce because it seemed to me that it was
> intermittent when I loaded files. Is it readily reproduceable
> using :drop? I use a variety of commands to load files.

Thanks for confirming the problem. When I use gvim --remote-tab-silent
(which triggers :tab drop in the existing Vim instance) Vim always ends
up in the wrong working directory for me, even when Vim was started with
the command line gvim -u NONE -U NONE --noplugin -N --cmd 'set acd'. So
yes, I can consistently reproduce this.

> I'd certainly like to see it fixed if it is not intentional for some
> reason.
>
> The workaround I found is to switch windows, tabs, or buffers, and
> come back to it, and 'acd' takes effect.

Executing :set acd or :edit again also works.

- Peter Odding

Reply all
Reply to author
Forward
0 new messages