-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow split terminal to inherit working directory from previous terminal #48447
Comments
shall i work on it ? |
@cedric05 I think this will need some ground work first to pull in the cwd in a nice way on all platforms which may be tricky. |
for windows there is no straight forward solution. |
I would find this really useful, as previously split terminal command splits at least for the same workspace. However that was gone in favor of split (in active workspace) two versions ago, which I don't find much useful. Example: Let's say I have two workspace A/B.
@Tyriar Is that intended? |
@octref the default split action now lets you select the workspace, just like the default create terminal action: |
@Tyriar I'm more looking at the Split in active workspace one, because I don't want to do the selection when splitting each time. Currently the active workspace seems to be determined by the current open file. I would expect it to be determined by the terminal from which I'm splitting. e.g.: If I have a terminal open on node-pty, splitting from it should always give me a terminal at the root of node-pty, no matter which file I'm on. |
@octref yeah that's what this feature request is about, right? |
@Tyriar Sorry, just found myself repeating myself unknowingly 😅 |
After chatting with @octref I found what would solve his problem is splitting taking the terminal.integrated.splitCwd: 'choose' | 'initialCwd';
|
@Tyriar, just want to make sure I understand: |
@alexr00 |
The follow up which we could do in October if you have time, would be to add a
|
Adds a new setting: `terminal.integrated.splitCwd` With these options: `workspaceRoot`, `sourceInitialCwd`, `sourceCwd` `workspaceRoot`is the existing behavior. The new split terminal's cwd will be the workspace root. `sourceInitialCwd` uses the 'parent' terminals initial cwd for the new terminal. `sourceCwd` on macOS and Linux this gets the cwd of the 'parent' terminal and uses that as the cwd for the new split terminal. Default setting is to keep the existing behavior with `workspaceRoot` Fixes #48447
@alexr00 I added a test plan item so we get better OS coverage for this one. |
Have an option to inherit previous session's directory, so when I'm splitting I always end up with two terminals of the same working directory. iTerm2 has this and is very useful:
The text was updated successfully, but these errors were encountered: