You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I wish to filter commands available in my default WSL2 shell, instead of filtering through PowerShell.
Describe the solution you'd like
One possible solution is to parse cmd args | cmd2 args2 into wsl cmd args | wsl cmd2 args2. In this case, no configs like bashrc are loaded.
Another possible solution, a better one, is to use the integrated terminal.
Additional context
Vim:
VSCodeVim:
As in, sh is not a recognized PowerShell command.
Hi @dpsigor, thanks for bringing this up. I'm testing some code that would involve allowing custom shells for filter commands as a VSCodeVim setting.
You'll then simply just need to add "vim.shell": "<path to WSL2 shell>" to your settings.json and your ! commands will use the WSL2 shell. I'll try and make a PR soon.
Another possible solution, a better one, is to use the integrated terminal.
I investigated this initially, but unfortunately VSCode doesn't offer a public API to get the output from an integrated terminal command, so redirecting output from an integrated terminal into the buffer is not possible without being very hacky.
They do have a proposed API vscode.window.onDidWriteTerminalData(), but turns out published extensions on the VSCode Marketplace cannot use such proposed APIs.
Refactors `externalCommand.ts` to use event emitters instead of temporary files to read the command output into the Vim buffer. This is much more cross-platform friendly. Creating temporary files and file paths are OS-dependent, which has made it difficult to build a `vim.shell` setting for #7100... so instead, this PR lets `exec`'s event emitters handle reading stdout/stderr for us.
Is your feature request related to a problem? Please describe.
I wish to filter commands available in my default WSL2 shell, instead of filtering through PowerShell.
Describe the solution you'd like
One possible solution is to parse
cmd args | cmd2 args2
intowsl cmd args | wsl cmd2 args2
. In this case, no configs like bashrc are loaded.Another possible solution, a better one, is to use the integrated terminal.
Additional context
Vim:
VSCodeVim:
As in, sh is not a recognized PowerShell command.
Filter commands were implemented with #5042.
The text was updated successfully, but these errors were encountered: