GithubHelp home page GithubHelp logo

tyriar / vscode-windows-terminal Goto Github PK

View Code? Open in Web Editor NEW
33.0 5.0 8.0 219 KB

VS Code integration with Windows Terminal

Home Page: https://marketplace.visualstudio.com/items?itemName=Tyriar.windows-terminal

License: MIT License

TypeScript 100.00%

vscode-windows-terminal's Introduction

Features

Explorer context menu

Open a particular Windows Terminal using the default profile or selecting a custom one on a folder via the explorer's right click context menu.

Context menu

These context menus can each be hidden independently using settings.

WSL Remote support

The context menu also works in WSL remotes, regardless of whether the terminal profile is WSL or not.

SSH Remote support

Opening the terminal when in a SSH remote workspace will ssh into the remote in Windows Terminal.

Dev container support

Opening the terminal when in a devcontainer remote workspaces will docker exec into the remote in Windows Terminal.

Several commands for launching WT

See the Feature Contributions tab for a full list of commands that can be setup with custom keybindings.

Requirements

Tips

If you do not use the integrated terminal you can change the built-in "Open in Terminal" context menu in the Explorer to open Windows Terminal's default profile by using these settings:

"terminal.explorerKind": "external",
"terminal.external.windowsExec": "wt"

vscode-windows-terminal's People

Contributors

dependabot[bot] avatar joinyy avatar moxwel avatar ricardosantos9521 avatar stuartleeks avatar tyriar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vscode-windows-terminal's Issues

Cannot open Windows Terminal from WSL when the folder name has spaces

I'm doing testing, and found that: if there is a folder (or folders) in the "Open in Windows Terminal" path with spaces in their names, Windows Terminal doesn't open.

Here I have 2 folders: folderWithoutSpaces and folder with spaces. I'm trying to open these in Windows Terminal.

From Windows environment. No problem.
windows

From Remote WSL environment. Cannot open folder with spaces.
wsl

Apparently this only occur with a Remote WSL environment in VSCode.

This extension is just what I was looking for, but I have some projects on folders where their names has spaces, and they gave me these errors because I use WSL.

Windows Terminal as external fails to open wsl terminal as default

Type: Bug

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.70.2
  • OS Version: Windows 11

Steps to Reproduce:

  1. Install windows terminal extension
  2. Install Windows Terminal app.
  3. Set in your settings.json:
    "terminal.explorerKind": "external",
    "terminal.external.windowsExec": "wt"
  1. Configure in Windows Terminal to open default terminal "Ubuntu" (WSL).
  2. Go to VS Code and press Ctrl+Shift+C to open external terminal. Output:
    image

What I would expect to happen is to open like this, in the current ${workspaceDirectory}:
image

Extension version: 0.7.0
VS Code version: Code 1.70.2 (e4503b30fc78200f846c62cf8091b76ff5547662, 2022-08-16T05:35:13.448Z)
OS version: Windows_NT x64 10.0.22000
Modes:
Remote OS version: Linux x64 5.10.102.1-microsoft-standard-WSL2

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 x 2419)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 11.79GB (1.70GB free)
Process Argv --crash-reporter-id bebcbdab-92ab-48c1-81d1-99b63faaf89c
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.10.102.1-microsoft-standard-WSL2
CPUs 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 x 2419)
Memory (System) 5.69GB (4.63GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
wslgetstarted:30449410
cppdebug:30492333
pylanb8912:30545647
vsclangdf:30486550
c4g48928:30535728
hb751961:30553087
dsvsc012cf:30540253
azure-dev_surveyone:30548225
i497e931:30552240

nls support ,

thanks.
and I don't know how to integrate vscode-nls. but I can provide Chinese translation

Terminal is not opened in the correct directory (WSL)

How to reproduce?

  • open a WSL folder in VSCode
  • right-click on a file in the VSCode file explorer and choose open in Windows Terminal (profile)
  • choose the WSL profile

What happens?

Windows Terminal is opened in ~

What should happen?

Windows Terminal should be opened in the file's folder instead.

Details

  • Windows 10 May 2020 update with Ubuntu 20.04 (WSL2)
  • VSCode 1.45.1
  • Windows Terminal Integration 0.5.0
  • Windows Terminal 1.0.1401.0

Note: that this may be related to microsoft/terminal#6022

Note 2: the same happens when right-clicking on Open in Terminal: the integrated terminal is opened in~ instead of the file's folder.

Alternative menu layout: use sub-menu for profile selection to avoid extra click

I would like to suggest an alternative or maybe even additional menu layout.

Instead of clicking on the command and then getting prompted for profile selection, the main menu entry could already contain a nested profile selection sub-menu.

This could either be configurable in the extension settings or co-exist with the main menu action.

Cannot read property 'toLowerCase' of undefined

Hello,

sadly the extension doesn't work for me on remote ssh.
If I click on "Open in Windows Terminal" via explorer then the integrated terminal opens.
If I click on "Open in Windows Terminal (Profile)" and click one of the options (doesn't matter which), I'm left with:

Could not launch Windows Terminal:
Cannot read property 'toLowerCase' of undefined

I have no clue what's causing this, I'm on Windows with remote ssh on Linux.
Windows Terminal is installed via Microsoft Store and my settings.json reads:

"terminal.explorerKind": "external",
"terminal.external.windowsExec": "wt",

Any help?

Cannot read property 'map' of undefined

I opened VSCode in a WSL directory, then right clicked on a folder and chose "Open in Windows Terminal" and got this error:

Could not launch Windows Terminal: Cannot read property 'map' of undefined

  • VSCode version 1.45.1
  • Ubuntu-20.04 on WSL 2
  • Windows Terminal 1.0.1401.0

Set default profile in settings.json

Every time I click "Open Windows Terminal" while in WSL Remote, it opens Powershell.

It would be useful if the default profile to open in Windows Terminal were set in settings.json.

windowsTerminal.defaultProfile: "<GUID>",

This can be used to set different default profiles per workspace, or in WSL Remote.

Reuse already opened terminal

Hello,

if I use the Windows Terminal on one ssh host and open up another ssh host then the Windows Terminal is opened up on a seperate window instead of the already opened one.
I'd love to have an option for "attach to already running wt.exe" or something like that.

Publishing `.vsix` release artifacts

Hi there👋!

It would be great if you could provide .vsix release artifacts in the GitHub Releases this repo publishes. I hope it wouldn't be too complex, it should be as straight forward as creating a GitHub Action, but I'd be happy to help out if anything is problematic. One could use an Action such as the one that the awesome people over at VS Code GitLens use, here it is: https://github.com/Axosoft/vscode-gitlens/blob/main/.github/workflows/cd-stable.yml.

For files, open WT in the file's directory

Thanks again for this @Tyriar! I am just reporting some small things after my first testing:

The command "Open in Windows Terminal" should not be available for files, but only for folders since opening a file with a shell does not make any sense.

'wsl.exe' is not recognized as an internal or external command

When I have a project open with Remote-WSL and attempt to run the "Windows Terminal:Open" command, I get the following error:

[2020-06-27 14:32:35.405] [renderer12] [error] Command failed: wsl.exe -d ubuntu-20.04 wslpath -w /home/stuart/source/devcontainer-cli
'wsl.exe' is not recognized as an internal or external command,
operable program or batch file.
: Error: Command failed: wsl.exe -d ubuntu-20.04 wslpath -w /home/stuart/source/devcontainer-cli
'wsl.exe' is not recognized as an internal or external command,
operable program or batch file.

	at ChildProcess.exithandler (child_process.js:308:12)
	at ChildProcess.emit (events.js:203:13)
	at maybeClose (internal/child_process.js:1021:16)
	at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

wsl.exe is in my path - I can run wsl.exe via Start/Run and it resolves via the path.

Let me know if any further info would be useful to debug this :-)

Set custom tab title

Hello,

currently the tab name in the terminal is only "OpenSSH SSH client" which is really confusing if you have multiple tabs (for example to different hosts)
I'd love to have an option for custom tab names, maybe with placeholders one could set.
For example something like: "windowsTerminal.tab.title": "VSCode: {ssh.hostname}"

Drive letter is lowercase

  • OS: Windows 10

When starting windows terminal I have a path with small letter of drive.

Screenshot from windows terminal

I fixed it, but I think it is not good solution.

let cwd = uri.fsPath
cwd = cwd.substring(0, 0) + cwd.charAt(0).toUpperCase() + cwd.substring(0 + 1)

console.log(cwd)

Screenshot from windows terminal

vs code issue

SSH config from WSL path not supported

Hello,

I use my ssh config from WSL so my setting is as follows:
"remote.SSH.configFile": "\\\\wsl$\\Ubuntu\\home\\USER\\.ssh\\config",
Which works just fine for Remote SSH, but doesn't work with this extension.

It just doesn't do anything if that setting is provided.
I also tried //wsl$/Ubuntu/home/USER/.ssh/config which also works just fine for Remote SSH, but not for the extension.

Any help?

[Bug] Windows terminal with remote linux machine via SSH

There is three bugs with remote ssh workspaces in vscode-windows-terminal extension:

  • the hostname obtained from the workspace path sometimes is not the real hostname of the remote machine.
  • the extension is using the windows username in the ssh communication even with linux and it should be using the predefined username in ms-vscode-remote.remote-ssh configuration file.
  • wt.exe does not accept ";" in ssh commands (ex wt.exe ssh [email protected] "cd ~; exec ...") it must be a bug with windows terminal.

P.S. I have a fixed this bugs and will submit them tomorrow as a pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.