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

calling executeCommand in onDidEndTerminalShellExecution causes recursion and the pty host to shutdown #226885

Closed
meganrogge opened this issue Aug 27, 2024 · 4 comments
Assignees
Labels
api bug Issue identified by VS Code Team member as probable bug *out-of-scope Posted issue is not in scope of VS Code terminal-shell-integration Shell integration infrastructure, command decorations, etc.
Milestone

Comments

@meganrogge
Copy link
Contributor

meganrogge commented Aug 27, 2024

Testing #226655

Use the vscode-extension-samples/terminal-shell-integration sample with this addition:

	vscode.window.onDidStartTerminalShellExecution(e => {
			e.shellIntegration.executeCommand('echo hi');
		}),
	vscode.window.onDidEndTerminalShellExecution(e => {
			e.shellIntegration.executeCommand('echo bye');
		}),

Create a terminal, run a command, see the pty host shutdown and see recursion in the terminal

@meganrogge
Copy link
Contributor Author

edit: also reproduces if you only add:

vscode.window.onDidEndTerminalShellExecution(e => {
	e.shellIntegration.executeCommand('echo bye');
}),

@meganrogge meganrogge changed the title calling executeCommand in both onDidStartTerminalShellExecution and onDidEndTerminalShellExecution causes recursion and the pty host to shutdown calling executeCommand in onDidEndTerminalShellExecution causes recursion and the pty host to shutdown Aug 27, 2024
@justschen
Copy link
Contributor

justschen commented Aug 27, 2024

I ran into this earlier as well but couldn't figure out what was causing it (my previous issue), but see it in onDidTerminalShellExecuition now as well

@Tyriar
Copy link
Member

Tyriar commented Aug 29, 2024

Not sure how I feel about this one as you're literally asking it to recurse. Maybe we need some throttling?

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug api terminal-shell-integration Shell integration infrastructure, command decorations, etc. labels Aug 29, 2024
@Tyriar Tyriar added this to the September 2024 milestone Aug 29, 2024
@Tyriar Tyriar modified the milestones: September 2024, Backlog Sep 23, 2024
@Tyriar
Copy link
Member

Tyriar commented Dec 10, 2024

Closing out of scope for now as no one else has hit this

@Tyriar Tyriar closed this as completed Dec 10, 2024
@Tyriar Tyriar added the *out-of-scope Posted issue is not in scope of VS Code label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api bug Issue identified by VS Code Team member as probable bug *out-of-scope Posted issue is not in scope of VS Code terminal-shell-integration Shell integration infrastructure, command decorations, etc.
Projects
None yet
Development

No branches or pull requests

3 participants