preservim / vimux

easily interact with tmux from vim
MIT License
2.2k stars 159 forks source link

VimuxRunCommandInDir: run in subshell #120

Closed bergman closed 9 years ago

bergman commented 9 years ago

Fixes a problem where the directory is not restored if the command exits with a non-zero code.

hpurmann commented 9 years ago

Now it never changes back to the old directory?!

bergman commented 9 years ago

@hpurmann It runs in a subshell. Try this in a shell:pwd && (cd / && pwd) && pwd

Edit: More information on subshells: http://www.tldp.org/LDP/abs/html/subshells.html

hpurmann commented 9 years ago

Oh nice! I didn't see the parenthesis at first. Learning never stops ;)

+1

bergman commented 9 years ago

@benmills any chance of merging this? I'm happy to answer any questions you might have.

hpurmann commented 9 years ago

@benmills Please merge this, we need it! :smiley:

bergman commented 9 years ago

Rebased on current master.

benmills commented 9 years ago

Slick! Thanks