File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -31,15 +31,15 @@ class UppTerm final : TopWindow {
3131 }
3232 }
3333
34- void Run (const String& cmd)
34+ int Run (const String& cmd)
3535 {
3636 m_terminal.WhenOutput = [&](String s) {
3737 m_pty.Write (s);
3838 };
3939 m_terminal.WhenResize = [&]() {
4040 m_pty.SetSize (m_terminal.GetPageSize ());
4141 };
42-
42+
4343 m_pty.Start (cmd.IsEmpty () ? GetEnv (tshell) : cmd, Environment (), GetHomeDirectory ());
4444
4545 OpenMain ();
@@ -53,7 +53,9 @@ class UppTerm final : TopWindow {
5353 break ;
5454 Sleep (l >= 1024 ? 1024 * 10 / l : 10 );
5555 }
56+ const auto exit_code = m_pty.GetExitCode ();
5657 m_pty.Kill ();
58+ return exit_code;
5759 }
5860
5961private:
@@ -74,5 +76,5 @@ GUI_APP_MAIN
7476 cmd.TrimEnd (" \" " );
7577 }
7678
77- UppTerm ().Run (cmd);
79+ SetExitCode ( UppTerm ().Run (cmd) );
7880}
You can’t perform that action at this time.
0 commit comments