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

[v16] Allow changing terminal shell in Teleport Connect #45734

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

gzdunek
Copy link
Contributor

@gzdunek gzdunek commented Aug 23, 2024

Backport #45152 to branch/v16

changelog: The terminal shell can now be changed in Teleport Connect by right-clicking on a terminal tab. This allows using WSL (wsl.exe) if it is installed. Also, the default shell on Windows has been changed to pwsh.exe (instead of powershell.exe).

* Get available shells for the system and store them in `RuntimeSettings`

* Add a config option for `terminal.shell`

* Add `shellId` to terminal documents and pty commands

* Pass the `shellId` from pty command to pty process options (and resolve it to the shell path)

* Allow changing the active and default shell from the context menu

* Show active shell in the tab name, drop "Terminal" from the name on Windows

* Fix resolving shell env for `csh`

* Do not read unix shells from `/etc/shells`, add a config property for the custom shell

* Add a whitelist of config properties that can be modified from the renderer

* Allow selecting custom shell

* Return back the actually opened shell and creation status

* Pass variables to WSL via WSLENV

* Do not change the default shell when selecting a custom shell

* Show profile switcher only when there is more than one shell to choose from

* Show shell name in the "Default Shell" context menu as sublabel

* Remove comment about sync setup of `setUpDeepLinks`

* Replace `MainTabContextMenuOptions` type

* Improve types in `subscribeToTabContextMenuEvent`

* Use early return

* Fix condition in the schema for `terminal.shell`

* Expand the comment for `preventAutoPromiseResolveOnMenuClose`

* Render available shells without an array

* `openedShell` -> `shell`

* Add tests for resolving shell

* Remove `PtyOptions`

* Preserve user defined WSLENV

* Remove the check for `fs.access(customShellPath)`

* Mock `process.env` instead of mutating it

* Fix remaining `openedShell` -> `shell`

* Fix `PATH` issue on Windows

* Remove updating a document with the default shell in `useDocumentTerminal`

* Add `canDocChangeShell`

* Omit the default shell name on Linux too

* Convert `buildPtyOptions` parameters to object, pass `process.env` from above

* Revert "Remove updating a document with the default shell in `useDocumentTerminal`"

This reverts commit 52f0485.

* Improve comments

* Throw when the document doesn't exist

(cherry picked from commit 806dcda)
@gzdunek gzdunek enabled auto-merge August 23, 2024 14:52
@gzdunek gzdunek added this pull request to the merge queue Aug 23, 2024
Merged via the queue into branch/v16 with commit 060cd47 Aug 23, 2024
37 checks passed
@gzdunek gzdunek deleted the gzdunek/backport-45152/v16 branch August 23, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants