-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix #5506: Make processId and cwd in TerminalWidget return promise when throw error #5553
Conversation
Currently, it works for me. |
@@ -203,22 +204,30 @@ export class TerminalWidgetImpl extends TerminalWidget implements StatefulWidget | |||
return this.term; | |||
} | |||
|
|||
get ready(): Promise<void> { |
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.
please don't expose it for now, keep protected
@BroKun How do you test it? Code-wise it looks good. |
d25d11d
to
e2bff98
Compare
…rn promise when throw error Signed-off-by: Brokun <brokun0128@gmail.com>
I modified the solution to this problem because I noticed that onDidOpen can fix the exceptions caused by the call sequence. However, since processId and cwd cannot be captured by reject when an exception is thrown, it causes a problem. As for testing, I feel that the current solution does not require special testing. The problem scenario can be observed by adding a wait time before the start method. |
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, really good catch with async code!
It is better to be safe and double check. |
Add the ready interface to ensure that the correct processId can be obtained.
Signed-off-by: Brokun brokun0128@gmail.com