Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

issue #46 - adding sendNamedTerminalCtrlC command with example #47

Merged

Conversation

bfitzpat
Copy link
Collaborator

@bfitzpat bfitzpat commented Feb 5, 2020

@bfitzpat
Copy link
Collaborator Author

bfitzpat commented Feb 5, 2020

didact-terminal-start-and-stop-ctrlc

Copy link
Collaborator

@lhein lhein left a comment

Choose a reason for hiding this comment

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

Nice. May I also suggest a CTRL-D command. Could come in handy especially when working with Terminals.

@bfitzpat
Copy link
Collaborator Author

bfitzpat commented Feb 5, 2020

Nice. May I also suggest a CTRL-D command. Could come in handy especially when working with Terminals.

Created #49

Copy link
Member

@apupier apupier left a comment

Choose a reason for hiding this comment

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

would be nice to have tests checking that normal text and Ctrl+c are correctly sent

src/extensionFunctions.ts Outdated Show resolved Hide resolved
src/extensionFunctions.ts Outdated Show resolved Hide resolved
@bfitzpat
Copy link
Collaborator Author

bfitzpat commented Feb 6, 2020

@apupier Added two new tests for the terminal work, but there isn't a clear way on how to test that things are actually send to the terminal. I can't get a hold of the text in the terminal itself. Any suggestions?

Signed-off-by: bfitzpat@redhat.com <bfitzpat@redhat.com>
Signed-off-by: bfitzpat@redhat.com <bfitzpat@redhat.com>
Signed-off-by: bfitzpat@redhat.com <bfitzpat@redhat.com>
@bfitzpat bfitzpat force-pushed the issue46-add-ctrlc-command branch from bc55837 to c08fcce Compare February 6, 2020 14:17
@bfitzpat
Copy link
Collaborator Author

bfitzpat commented Feb 6, 2020

@lhein found this https://stackoverflow.com/questions/57630371/how-to-use-terminal-api-to-listen-to-all-terminal-output-in-vscode which seems to be in the Insiders build. Once it appears in a public API form, maybe we can use it to watch for data changes in terminals.

@apupier
Copy link
Member

apupier commented Feb 6, 2020

Once it appears in a public API form, maybe we can use it to watch for data changes in terminals.

sounds a great plan. I let you create the issue so that we don't forget

terminalC = extensionFunctions.findTerminal(testTerminalName);
assert.notEqual(terminalC, undefined);

// again, open to ideas on how to check to see if the terminal text was sent to the active terminal
Copy link
Member

Choose a reason for hiding this comment

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

we can use "side-effects", like the text sent to the terminal is to create a file somehwere and then we check that the file is created. But it seems a bit too effort for the value. I prefer the idea to wait for listener outputchannel content pointed by Lars to be in VS Code APi.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good. I'll create an issue so we can update the tests when we see the new functionality in an upcoming build.

Copy link
Member

Choose a reason for hiding this comment

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

oh wait here we are on the Ctrl, so the terminal shoudl have been deleted, right? so would say current test is enough

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Terminal does not get deleted - that's a different issue. The terminal just halts any long-running process.

Copy link
Member

Choose a reason for hiding this comment

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

oh my bad I misunderstood, so I guess we will wait for the listener APi to be available

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#49 will add a new command to close the terminal

terminal = extensionFunctions.findTerminal(testTerminalName);
assert.notEqual(terminal, undefined);

// open to ideas on how to check to see that a message was actually committed to the terminal
Copy link
Member

Choose a reason for hiding this comment

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

we can use "side-effects", like the text sent to the terminal is to create a file somehwere and then we check that the file is created. But it seems a bit too effort for the value. I prefer the idea to wait for listener outputchannel content pointed by Lars to be in VS Code APi.

@bfitzpat bfitzpat merged commit b0ed851 into redhat-developer:master Feb 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants