If you open a new tab within terminal.app
, the tab will automatically point to the directory of the tab from which you've opened the new one.
It's a pretty handy feature, so I think it should also be in hyperterm!
Already part of the "TODO" list. IMHO, all of these should be issues though.
I wonder if we should make this the default behavior? Or a default plugin that's enabled built-in?
It looks like there are people (like @oskarkrawczyk), who don't like this. So the best way to handle it would probably be something that's enabled by default (like with terminal.app), but can also be disabled.
Is there a special reason to make it a plugin? IMHO, it should just be a config option.
@leo I shouldn't have downvoted the whole comment โ I just think this would be a cool addition, but perhaps a bit too much as the default behavior. It's purely subjective, but I never did like this is Terminal.
If you use tmux, it already has this feature when you create new pane.
I think default behavior should be $HOME directory as in other terminals.
Or you can have checkbox for tmux-like behavior.
I agree with @leo. In various terminal emulators this is typically a user preference set in config.
Just to call a few things out here.
This is line that opens the terminal to $HOME directory:
https://github.com/zeit/hyperterm/blob/master/session.js#L26
I like the idea of making this a plugin, but adding it to the default config plugins.
This follows the pattern that Atom editor set out solid defaults that you can change
@rauchg I'm reverse engineering some of the code, and the deeper I dig the more I think I need to provide some hooks into the session before I can write a plugin. Does that seem right to you?
I _think_ the above commit should provide what's needed to solve this. For this to work the plugin would need to update the session's cwd when it changes. Still feel like I'm missing something obvious though.
So I've got this working locally now!
Accepting #174 and adding hypercwd
to your list of plugins in ~/.hyperterm.js will make this available.
There's a couple things to think about before closing this out.
Do we add a plugin (like hypercwd - yes I'm biased ๐) to the default config or leave it to the user to add it.
If we add it by default will it re-add every time HyperTerm gets updated? If it does, probably will want to prevent that from happening.
P.S. The plugin API is awesome!
Also same directory for new window would be great.
@alexfedoseev Great idea! But please move your issue over to hypercwd.
Who's ๐ on adding hypercwd as a default plugin? I definitely am!
Just ๐ or ๐ this comment.
I'm ๐ for adding it as a feature, not as a default plugin ๐
@leo Sure, done!
I'm ๐ for adding it as a default plugin or feature. I'd much prefer to be able to pick a default directory with something like this plugin I made: hyperterm-working-directory
.
I'd be more open about a built-in feature like hyperterm-working-directory
, but with the ability to use the last cwd
(e.g by setting workingDirectory
to'<mirror>'
).
Many users expect a constant default directory, this is something you can do in iTerm 2+, for example
This is mostly a feature needed when you do a split plan of a current projet, Let say I have one pane for running npm run dev
and in the other pane npm start
. So opening the new pane with the same pwd is handy. But not for new tab since they mostly table differents concert or call.
HyperCWD doesn't work anymore... get runtime errors when opening new tab.
@JonathanNathanson It's working on mine
Try updating?
hypercwd doesn't seem to work on Windows 10.
Any news on window? Still facing runtime error when trying to open new terminal with hypercwd installed.
Uncaught Exception:
Error: Unable to start terminal process: CreateProcess failed
at new WindowsPtyAgent
....
Most helpful comment
Who's ๐ on adding hypercwd as a default plugin? I definitely am!
Just ๐ or ๐ this comment.