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

onDidOpenTerminal fires twice for send text #226893

Open
justschen opened this issue Aug 27, 2024 · 2 comments
Open

onDidOpenTerminal fires twice for send text #226893

justschen opened this issue Aug 27, 2024 · 2 comments
Assignees

Comments

@justschen
Copy link
Contributor

justschen commented Aug 27, 2024

Testing #226655

vscode.window.onDidOpenTerminal(e => {
			e.sendText('echo hi');
		}),

this ends up firing twice or an extra "echo hi" shows up

Screenshot 2024-08-27 at 2 26 06 PM

@justschen justschen changed the title onDidOpenTerminal fires twice fpr send text onDidOpenTerminal fires twice for send text Aug 27, 2024
@justschen
Copy link
Contributor Author

also it seems like e.shellIntegration?.executeCommand('echo hi'); does not work in onDidOpenTerminal

@meganrogge
Copy link
Contributor

@justschen, it's not firing twice. The input is received before the prompt starts, so it gets written to the terminal. You can repro this if you create a terminal and type quickly like the below.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants