Skip to content

Conversation

@ThinkSalat
Copy link

fixes #2043

Adds Terminal to the list of shells available for running shell commands.

Cmd = 0,
Powershell = 1,
RunCommand = 2,
Terminal = 3,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Would it make sense for this to be named Windows Terminal ?
  2. Do we need translations for this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just called Terminal, and flow launcher is windows only, so I don't think the distinction is necessary. As for translations, the other options aren't translated, so it kind of be adding too much responsibility to this PR.

Copy link
Contributor

@VictoriousRaptor VictoriousRaptor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I test it I got the following error
图片

@ThinkSalat
Copy link
Author

When I test it I got the following error 图片

Looking into it

@jjw24 jjw24 added the enhancement New feature or request label Apr 16, 2023
@jjw24 jjw24 added this to the 1.15.0 milestone Apr 16, 2023
@VictoriousRaptor
Copy link
Contributor

Related to #1116

@jjw24 jjw24 modified the milestones: 1.15.0, Future May 2, 2023
@Azakidev
Copy link
Contributor

Azakidev commented Feb 4, 2025

Hi,

This happens because the arguments given are for pwsh, not for windows terminal
It should specify the shell that will open and use the correct arguments if needed

It would look something like this for powershell and cmd respectively:

case Shell.TerminalPWSH:
{
    info.FileName = "wt.exe";
    info.ArgumentList.Add(pwsh)
    if (_settings.LeaveShellOpen)
    {
        info.ArgumentList.Add("-NoExit");
        info.ArgumentList.Add("-c");
        info.ArgumentList.Add(command);
    }
    else
    {
        info.ArgumentList.Add("-c");
        info.ArgumentList.Add(command);
    }
    break;
}

case Shell.TerminalCMD:
{
    info.FileName = "wt.exe";
    info.ArgumentList.Add(cmd)
    if (_settings.LeaveShellOpen)
    {
        info.ArgumentList.Add("/k");
        info.ArgumentList.Add(command);
    }
    else
    {
        info.ArgumentList.Add("/c");
        info.ArgumentList.Add(command);
    }
    break;
}

Ideally it would automatically use the default profile and none of this would be necessary, but I'm not quite sure if it can as of now

@Azakidev
Copy link
Contributor

Azakidev commented Feb 4, 2025

After looking just a bit more
It's pretty much how Powertoys run does it.
As can be seen in their implementation.

Hope this helps!

@VictoriousRaptor
Copy link
Contributor

Close as #3225 implements it.

@jjw24 jjw24 removed this from the Future milestone Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[open shell commands in new terminal tab]

5 participants