-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
wt new-tab open near current tab #14687
Comments
There is the parameter in Preview version:
Command will open new tab near current tab:
|
It would be okay to reuse the enum type though. |
This function is somewhat like duplicating a tab #14313 but I'm specifying a different profile for the duplicate. OTOH, if I had manually changed the color of the Bash tab, it would be okay for the new PowerShell tab to inherit that. |
Changing the configuration via settings.json for most settings happens on the fly. Something like: # pwsh
# $WT_SETTINGS is the custom environment variable
function vsbash {
param (
[Parameter()]
[switch] $near
)
$json = Get-Content $WT_SETTINGS | ConvertFrom-Json
if ($near) { $json.newTabPosition = 'afterCurrentTab' }
else { $json.newTabPosition = 'afterLastTab' }
$json | ConvertTo-Json -Depth 5 | Set-Content $WT_SETTINGS
wt --window 0 new-tab --profile "bash" --startdirectory "."
}
|
Okay there's two thoughts here:
We might want to workshop the parameters a bit. Vague todo list:
|
HEY ! CAN I HAVE MY HANDS ON THIS ISSUE ? |
GO FOR IT! FEEL FREE TO COMMENT IF YOU HAVE ANY QUESTIONS |
hello |
Yes. |
Hello,I'd like to take this up as my very first contribution to get into open source. After cloning the repo and opening the
Any pointers or links to external references would be really helpful. Thank you for your time. |
As a prerequisite you need to use VS 2022: https://github.com/microsoft/terminal#prerequisites
It already has an index parameter which defaults to -1 (= unspecified), so only the callers need to be updated to use the current tab-index instead. To test your changes simply build WindowsTerminal and run it. We'll then test the changes again around the time we merge your PR. |
Please note the request is for opening a new tab near the "tab in which I run the command", which might not be the selected tab of the window. For example, say I have a window with three tabs A, B, and C, and I run |
I have seen that you can open a tab with a shortcut keybind but how do you achieve to open a new tab using |
So, |
I'm currently working on this feature request here: main...nivowski:terminal:feature/wt-new_tab_position It run with success but doesn't work when trying to pass the --tabPosition parameter( Any help would be much appreciated |
vspwsh ()
} |
Description of the new feature/enhancement
I have a Bash function that opens a tab with PowerShell in the current directory:
I'd like this to place the new PowerShell tab next to the Bash tab in which I run the command. That way, it would be easier for me to keep track of the purpose of each tab, keeping tabs near each other when they are for working on the same directory.
This is somewhat related to #3158 but would not depend on any escape sequences emitted by the shell.
Proposed technical implementation details (optional)
Add a
--near-current-tab
option towt new-tab
. When specified, use the WT_SESSION environment variable to find the session, tab, and window in which the command was run, and place the new tab near that one.If both
--near-current-tab
and--window
are specified, then ignore WT_SESSION and instead use the selected tab of the specified window.The text was updated successfully, but these errors were encountered: