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

Window doesn't close on "exit" #170

Closed
otatski opened this issue Apr 16, 2023 · 1 comment
Closed

Window doesn't close on "exit" #170

otatski opened this issue Apr 16, 2023 · 1 comment

Comments

@otatski
Copy link

otatski commented Apr 16, 2023

Issue type: Bug

Description:
When running the example app terminal, the window doesn't close after typing "exit". Instead, the terminal prints "the process exited with exit code 0" and remains open. The user has to click the close button to close the window manually.

Steps to reproduce:

  1. Run the example app terminal.
  2. Type "exit" and press Enter.

Expected behavior:
After typing "exit" and pressing Enter, the window should close.

Actual behavior:
The window doesn't close. It only prints "the process exited with exit code 0" and remains open.

Environment:

OS: Pop OS 22.04
Flutter SDK: >=2.17.0 <3.0.0
xterm: ^3.4.1
flutter_pty: ^0.3.0

Screenshots:
terminal_no_exit

Error messages: None

Additional information:
Please let me know if any additional details are required to reproduce and diagnose this issue.

@otatski
Copy link
Author

otatski commented Apr 16, 2023

I resolved the issue. I don't know why I didn't think to do this originally.

pty.exitCode.then((code) {
    terminal.write('the process exited with exit code $code');
    exit(code);
});

@otatski otatski closed this as completed Apr 16, 2023
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

1 participant