amjith / zazu-mac-open-terminal

MIT License
6 stars 7 forks source link

Creates a new terminal each time #2

Open afaur opened 8 years ago

afaur commented 8 years ago

Not really an issue exactly, but something that wouldn't work for my current setup.

I use a long running tmux session for all of my terminal activity, and each time my terminal starts or reattaches to a specific set of tmux windows the change directory would be lost. To make this work for my situation I modified the iterm2 script to type the cd path into an existing iterm2 process if found.

The changes I made can be viewed here: https://github.com/afaur/zazu-mac-open-terminal/commit/e8cde484874b2e8a83e7a31acc70c2d0eb9fe3df

As I don't think this fits the normal use case I just wanted to mention it here as a guide if anyone else wanted to see an example.

amjith commented 8 years ago

Interesting suggestion. I use tmux as well, I might either adopt this script myself or find a way to configure this behavior via the zazurc.js file.

bayleedev commented 8 years ago

Would it be better to create a new tmux pane/window if one is active? Modifying a current pane could be annoying. A new one can be moved to the "correct" spot, but modifying one would be a weird like "pwd | pbcopy && cd -" then a "create new split && cd $(pbpaste)" kind of thing.

amjith commented 8 years ago

I like the idea of a new window inside the current tmux session. Since we can't know what is currently running in the active window, blindly executing cd path might produce undesirable results. I typically run my Vim in terminal and if the plugin decides to run cd path inside Vim that will surely mess up the file that is currently open.

afaur commented 8 years ago

Maybe there could be an option that will copy the path to your clipboard, and then you could just go to your terminal and do with it what you will?

I think I like that personally for now so I went ahead and set that up, but not the option part. I think the manual paste is okay for me. (https://github.com/afaur/zazu-mac-open-terminal/pull/2/commits/7678fffef1282eb8b0084572e724c777ae0ad125)