microsoft / microsoft/terminal

wt new-tab open near current tab

Open
#14,687 22 comments 0 reactions 0 assignees View on GitHub
Area-Commandline good first issue Help Wanted In-PR Issue-Task Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

# Description of the new feature/enhancement

I have a Bash function that opens a tab with PowerShell in the current directory:

```sh
vspwsh ()
{
wt new-tab --profile "Developer PowerShell for VS 2017" --startingDirectory .
}
```

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 but would not depend on any escape sequences emitted by the shell.

# Proposed technical implementation details (optional)

Add a `--near-current-tab` option to `wt 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.

Contributor guide

Open the contributing guide

Research direction

Start at the `wt new-tab` command entry point and trace how `WT_SESSION` identifies the current session, tab, and window. Check how `--window` selects a window, then define the behavior for `--near-current-tab`, including when both options are supplied; done means the new tab opens next to the invoking or selected tab.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, shell
Domain
cli, desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.