-
Notifications
You must be signed in to change notification settings - Fork 25
issue #46 - adding sendNamedTerminalCtrlC command with example #47
issue #46 - adding sendNamedTerminalCtrlC command with example #47
Conversation
There was a problem hiding this 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.
Created #49 |
There was a problem hiding this 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
@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>
bc55837
to
c08fcce
Compare
@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. |
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Signed-off-by: bfitzpat@redhat.com bfitzpat@redhat.com