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

Switch over to executeCommand from sendText #24078

Merged
merged 37 commits into from
Sep 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2413118
vscode engine to 1.93
anthonykim1 Sep 9, 2024
5de9ca5
use executeCommand
anthonykim1 Sep 9, 2024
6d1f522
codeaction mock
anthonykim1 Sep 9, 2024
c9fc4f1
compile
anthonykim1 Sep 9, 2024
0d78806
switching version allows debugging - magically
anthonykim1 Sep 10, 2024
a16a102
pin version to equal to or above 1.93
anthonykim1 Sep 10, 2024
ea24d50
try to fix unit test
anthonykim1 Sep 10, 2024
2cb1eb3
Debt: switch Promise<void> in ensureTerminal to Promise<Terminal>
anthonykim1 Sep 10, 2024
88b4e9f
passing test when shell integration disabled
anthonykim1 Sep 10, 2024
6ecf4fc
please
anthonykim1 Sep 10, 2024
831f893
// @ts-ignore: TS6133
anthonykim1 Sep 10, 2024
f3aa28e
a
anthonykim1 Sep 10, 2024
342587a
stop
anthonykim1 Sep 11, 2024
3efaf9a
try idisposable
anthonykim1 Sep 11, 2024
d3b2238
more trials
anthonykim1 Sep 11, 2024
28ef3c1
lint
anthonykim1 Sep 11, 2024
2375490
slowly migrate test from sendText to executeCommand
anthonykim1 Sep 11, 2024
a75656b
TODO: test for when shellIntegration is active, mock and fire onDidEn…
anthonykim1 Sep 11, 2024
a51b6b4
onDidEndTerminalShellExecution never gets fired
anthonykim1 Sep 11, 2024
7c01537
switch up the order
anthonykim1 Sep 11, 2024
923df5c
add test onDidEndTerminalShellExecutionEmitter.fire(event)
anthonykim1 Sep 11, 2024
16839c9
attach callback to executeCommand so onDidEndTerminalShellExecutionEm…
anthonykim1 Sep 11, 2024
e30bb77
switch up the order abit + comment
anthonykim1 Sep 11, 2024
e69c490
wow
anthonykim1 Sep 11, 2024
e2e71d0
remove junk
anthonykim1 Sep 11, 2024
3d31d1a
remove unused
anthonykim1 Sep 11, 2024
46d28d2
remove comment
anthonykim1 Sep 11, 2024
5d3878f
TODO: smart send smoke test are flaky on windows
anthonykim1 Sep 11, 2024
dfe61de
a
anthonykim1 Sep 11, 2024
8f9ab0d
take recommended feedbacks
anthonykim1 Sep 12, 2024
6d095c8
remove leftover comments - done
anthonykim1 Sep 12, 2024
563fb12
final
anthonykim1 Sep 12, 2024
145e2fd
remove weird import
anthonykim1 Sep 12, 2024
8bc3951
last missed comment
anthonykim1 Sep 12, 2024
610d0fb
upgrade actions/download-artifact@v4
anthonykim1 Sep 12, 2024
c6a4713
why
anthonykim1 Sep 12, 2024
2b4c2bf
try with actions/download-artifact@v3
anthonykim1 Sep 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Debt: switch Promise<void> in ensureTerminal to Promise<Terminal>
  • Loading branch information
anthonykim1 committed Sep 10, 2024
commit 2cb1eb3c532928b616f3f7fc1faa61699fc2da40
14 changes: 9 additions & 5 deletions src/client/common/terminal/service.ts
Original file line number Diff line number Diff line change
@@ -74,7 +74,8 @@ export class TerminalService implements ITerminalService, Disposable {
this.terminal!.sendText(text);
}
public async executeCommand(commandLine: string): Promise<ITerminalExecutedCommand | undefined> {
const terminal = await this.ensureTerminal();
// const terminal = await this.ensureTerminal();
anthonykim1 marked this conversation as resolved.
Show resolved Hide resolved
const terminal = this.terminal!;
if (!this.options?.hideFromUser) {
terminal.show(true);
}
@@ -118,9 +119,11 @@ export class TerminalService implements ITerminalService, Disposable {
this.terminal!.show(preserveFocus);
}
}
public async ensureTerminal(preserveFocus: boolean = true): Promise<Terminal> {
// TODO: Debt switch to Promise<Terminal> ---> breaks 20 tests
public async ensureTerminal(preserveFocus: boolean = true): Promise<void> {
if (this.terminal) {
return this.terminal;
// return this.terminal;
return;
}
this.terminalShellType = this.terminalHelper.identifyTerminalShell(this.terminal);
this.terminal = this.terminalManager.createTerminal({
@@ -133,7 +136,7 @@ export class TerminalService implements ITerminalService, Disposable {
// Sometimes the terminal takes some time to start up before it can start accepting input.
await new Promise((resolve) => setTimeout(resolve, 100));

await this.terminalActivator.activateEnvironmentInTerminal(this.terminal!, {
await this.terminalActivator.activateEnvironmentInTerminal(this.terminal, {
resource: this.options?.resource,
preserveFocus,
interpreter: this.options?.interpreter,
@@ -145,7 +148,8 @@ export class TerminalService implements ITerminalService, Disposable {
}

this.sendTelemetry().ignoreErrors();
return this.terminal;
// return this.terminal;
return;
}
private terminalCloseHandler(terminal: Terminal) {
if (terminal === this.terminal) {