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

only run selected texts in a user terminal #7453

Merged
merged 1 commit into from
Apr 6, 2020

Conversation

elaihau
Copy link
Contributor

@elaihau elaihau commented Mar 30, 2020

  • The selected texts are only run in a user terminal.
    If the terminal widget that has the focus

    1. is not a user terminal, or
    2. is a user terminal that has an actively running command,
      Theia should create a new user terminal and run the selected texts in that new terminal.
  • fixes 'Run Selected Text' is not working when a task is stopped #7323

Signed-off-by: Liang Huang lhuang4@ualberta.ca

How to test

  1. Start a task.
  2. Highlight texts
  3. Run highlighted texts by going to the top menu bar Terminal -> Run selected text
    Expected:
  • The selected text should not simply be dumped into the terminal (where the task is running / ran) as a string
  • The selected text should be run as a shell command in a user terminal
  • If the visible terminal is not a user terminal, a new user terminal should be created to run the selected text as a shell command

Peek 2020-03-30 15-35

Review checklist

@vince-fugnitto vince-fugnitto added tasks issues related to the task system terminal issues related to the terminal labels Mar 30, 2020
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I verified the changes and they look good:

  1. run selected text correctly spawns a new terminal (if none exist)
  2. run selected text still works correctly after a task has been executed
  3. a new terminal is created if the terminal with a task has focus

It might be out of scope of the pull-request, but one scenario I see will need some work or clarification:

  1. execute run selected text (a new terminal is created)
  2. open the problems-view (it has focus)
  3. execute run selected text (the selected text is run in the first terminal but it is hidden by the problems-view)

- The selected texts are only run in a user terminal.
  If the terminal widget that has the focus
  1) is not a user terminal, or
  2) is a user terminal that has an actively running command,
  Theia should create a new user terminal and run the selected texts in that new terminal.

- fixes #7323

Signed-off-by: Liang Huang <lhuang4@ualberta.ca>
@elaihau elaihau force-pushed the Liang/runTextInTaskTermimalOnly branch from f45ea09 to 9a27ec0 Compare April 6, 2020 11:52
@elaihau elaihau merged commit d96e6f1 into master Apr 6, 2020
@elaihau elaihau deleted the Liang/runTextInTaskTermimalOnly branch April 6, 2020 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tasks issues related to the task system terminal issues related to the terminal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Run Selected Text' is not working when a task is stopped
3 participants