Skip to content
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

Add a CLI executable for interacting with WT (wtcli.exe or something) #11616

Closed
Tracked by #4632
3N4N opened this issue Oct 26, 2021 · 5 comments
Closed
Tracked by #4632

Add a CLI executable for interacting with WT (wtcli.exe or something) #11616

3N4N opened this issue Oct 26, 2021 · 5 comments
Labels
Area-Commandline wt.exe's commandline arguments Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Milestone

Comments

@3N4N
Copy link

3N4N commented Oct 26, 2021

Description of the new feature/enhancement

With the command sendInput I can invoke shell commands with a key-binding. But that would send the input directly to the pane currently in focus. I want to invoke a shell command in the background. Kind of like how moveFocus command operates.

The specific use-case I want this for is navigating between vim and wt splits with one set of keybindings. As of now, I have to use two sets: one for vim (ctrl-h/j/k/l) and another for wt (ctrl-alt-h/j/k/l). I'm used to tmux and had a config which achieved exactly this purpose.

I can do half of the work from vim: when inside vim, I can check if there are other vim splits in the direction I want to move focus toward, and if not, I move over to the wt split in that direction, with the command wt -w 0 mf <direction>.

But that's only half the work. Now I have to configure wt to send the key to vim if the current wt split is harboring a vim spawn. In tmux, I had a way to --

  1. See if the focused split has vim open
    tmux display-message -p '#{pane_current_command}' | grep -iq vim
  2. Bind a key to a complex bash command
    bind -n C-h run \
             "((tmux list-panes -F '#F' | grep -q Z && tmux send-keys C-h) || \
             ((tmux display-message -p '#{pane_current_command}' | grep -iq vim \
               && tmux send-keys C-h) || tmux select-pane -L ))"

None of which is achievable in wt. Or I haven't found a way.

By the way, I noticed that the shell command wt -w 0 mf <direction> is slower than the native moveFocus command. And I think the shell variant even opens a new wt window for a split second. Why is that?

@3N4N 3N4N added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Oct 26, 2021
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 26, 2021
@DHowett
Copy link
Member

DHowett commented Oct 26, 2021

Why is that?

I can't address the rest of this request right now, but I can probably explain this!

When you run an external application from within Vim, it runs it through vimrun. vimrun is a console application, and every console application gets a new console window.

@3N4N
Copy link
Author

3N4N commented Oct 27, 2021

I'm not invoking that wt -w 0 mf command from inside vim, though. I'm invoking it from a normal cmd. Let me see if I can create a GIF.

Edit(27/09/2021): Here is a video.

cropped.mp4

Edit 2 (12/06/2022): As of now, it doesn't open a new windows-terminal. So that confusion is now beside the point. But -- and I'm sorry for pinging you again @DHowett -- have you guys added any functionality equivalent to tmux's pane_current_command which will let the user do stuff based on the program currently running on a pane?

@zadjii-msft
Copy link
Member

Hey sorry for leaving this untriaged for so long.

This thread's a little hard to parse, but I suppose ultimately the request here was for something like

wt display-message -p '#{pane_current_command}'

(and other commandline output about the state of wt)

That's kinda Hard at the moment. This comment has details: #4570 (comment)

We actually don't have an issue open tracking a separate CLI exe for interacting with wt. Coulda swore we did, but until we do, this thread is gonna become that one. Thanks!

@zadjii-msft zadjii-msft changed the title Add command to execute shell commands in the background unlike sendInput Add a CLI executable for interacting with WT (wtcli.exe or something) Aug 22, 2022
@zadjii-msft zadjii-msft added the Area-Commandline wt.exe's commandline arguments label Aug 22, 2022
@zadjii-msft zadjii-msft added this to the Backlog milestone Aug 22, 2022
@zadjii-msft zadjii-msft added Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 22, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Aug 22, 2022
@zadjii-msft
Copy link
Member

GAH no I found it. Sorry for the runaround!

/dup #7258

@zadjii-msft zadjii-msft closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2022
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Aug 22, 2022
@ghost
Copy link

ghost commented Aug 22, 2022

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Aug 22, 2022
@ghost ghost added the Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. label Aug 22, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Commandline wt.exe's commandline arguments Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants