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

feat: Return back the built-in VS Code terminal with the Shell Integration enabled #124

Merged
merged 2 commits into from
Oct 5, 2022

Conversation

azatsarynnyy
Copy link
Member

@azatsarynnyy azatsarynnyy commented Oct 5, 2022

Signed-off-by: Artem Zatsarynnyi [email protected]

What does this PR do?

  • Returns back the VS Code built-in terminal with all its features enabled (e.g. Shell integration, contributed Terminal Profiles, etc.).
  • Returns back the possibility of running any non-Che VS Code Tasks, but not Che Tasks (Devfile Commands) only.
  • Enables the PowerShell VS Code extension to work properly.

This is step 3/3 in migrating from the current implementation of the machine-exec-based terminal, that replaces the built-in VS Code terminal, to the dedicated extension.
1/3 was introduced in #122.
2/3 was introduced in #123.

What issues does this PR fix or reference?

related to:

How to test this PR?

Test opening the terminals

Use case 1: there're multiple contributed containers
  1. Start a DevWorkspace with the test project https://github.com/azatsarynnyy/java-spring-petclinic/tree/trm-ext-multiple
  2. In the Command Palette, call the command Terminal: Create New Terminal to DevWorkspace Container.
  3. VS Code should ask to choose a container as there're several contributed containers except for the editor's container.
Use case 2: there's one contributed container (except for the editor's container)
  1. Start a DevWorkspace with the test project https://github.com/azatsarynnyy/java-spring-petclinic/tree/trm-ext
  2. In the Command Palette, call the command Terminal: Create New Terminal to DevWorkspace Container.
  3. VS Code should not ask to choose a container as there's a single contributed container (mariadb) except the editor's container.
  4. VS Code should open a terminal to the container mariadb.
Use case 3: there're no contributed containers (except for the editor's container)

In this case, the behavior should be exactly the same as opening a built-in VS Code terminal.

  1. Start a DevWorkspace with the test project https://github.com/azatsarynnyy/java-spring-petclinic/tree/trm-ext-0
  2. In the Command Palette, call the command Terminal: Create New Terminal to DevWorkspace Container.
  3. VS Code should not ask to choose a container as there're no contributed containers except for the editor's container.
  4. VS Code should open a terminal to the editor container tools.
  5. Check that the opened terminal is a full-featured built-in terminal, not the machine-exec terminal. They differ in that the machine-exec terminal doesn't support features like Shell Integration.

It should be possible to run any Task (not only Devfile Commands) in a VS Code built-in terminal

  1. Start a DevWorkspace with the test project https://github.com/azatsarynnyy/java-spring-petclinic/tree/term-native
  2. Create test tasks.json with a shell task. E.g.: Terminal > Configure Tasks... > Create tasks.json file from template > maven.
  3. Run any shell task: verify or test.
  4. The task should be executed as expected. It shouldn't hang as described in It's not possible to run a Task in Che-Code if it's not che type eclipse-che/che#21466.

che tasks (Devfile Commands) should be run via the machine-exec terminal

  1. Start a DevWorkspace with the test project https://github.com/azatsarynnyy/java-spring-petclinic/tree/term-native
  2. Try to run a Che Task. E.g.: Terminal > Run Task... > che.
  3. The task should be executed as expected. Under the hood, the task is executed by calling the che-terminal extension's API. It can be verified by checking the Che Terminal output channel (View > Output).

Test PowerShell extension functionality

  1. Start a DevWorkspace with the test project https://github.com/azatsarynnyy/PowerShellEditorServices/tree/trm-ext.
  2. Go to the Extensions side-panel view and install the recommended PowerShell extension.
  3. Make sure a new Terminal Profile pwsh is contributed to the Launch Profile... menu.
  4. After activating the extension (e.g. on opening a *.ps1 file), a new terminal PowerShell Extension is launched automatically.
  5. Check the editor autocompletion in the *.ps1 file work as expected.
  6. Check that the PowerShell left-side panel is populated with the commands.
  7. Check that no problems are reported in the extension's logs (View>Output).

@azatsarynnyy azatsarynnyy changed the title feat: Return back the built-in VS Code terminal [WIP] feat: Return back the built-in VS Code terminal Oct 5, 2022
@azatsarynnyy azatsarynnyy changed the title [WIP] feat: Return back the built-in VS Code terminal [WIP] feat: Return back the built-in VS Code terminal with the Shell Integration enabled Oct 5, 2022
@azatsarynnyy azatsarynnyy marked this pull request as ready for review October 5, 2022 16:59
@azatsarynnyy azatsarynnyy changed the title [WIP] feat: Return back the built-in VS Code terminal with the Shell Integration enabled feat: Return back the built-in VS Code terminal with the Shell Integration enabled Oct 5, 2022
@azatsarynnyy azatsarynnyy enabled auto-merge (rebase) October 5, 2022 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants