File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ export default {
6565 continue ;
6666 }
6767
68+ // TODO: have an actual builtin processor instead of just reading input here
69+ if ( input === "exit" ) {
70+ running = false ;
71+ break ;
72+ }
73+
6874 shell . memory . add_history_entry ( input ) ;
6975 await shell . execute ( input ) ;
7076 }
Original file line number Diff line number Diff line change @@ -197,14 +197,9 @@ export default {
197197 current_tty_process = boot_target_proc . process ;
198198
199199 const exit_code = await boot_target_proc . completion ;
200-
201- if ( exit_code === 0 ) {
202- running = false ;
203- }
204-
205200 console . log ( `boot target ${ boot_target } exited with code ${ exit_code } ` ) ;
206201
207- // TODO: error recovery logic
202+ // TODO: error recovery logic if boot target fails multiple times in a row
208203 }
209204
210205 return final_code ;
Original file line number Diff line number Diff line change 11import type { Program } from "../../types" ;
22import type { ProcessContext } from "../../processes" ;
3+ import { ANSI } from "../../term_ctl" ;
34
45export default {
56 name : "jetty" ,
@@ -57,11 +58,22 @@ export default {
5758
5859 const exit_code = await shell_proc . completion ;
5960
60- if ( exit_code === 0 ) {
61- running = false ;
61+ console . log ( `default shell ${ default_shell } exited with code ${ exit_code } ` ) ;
62+
63+ // early break in case jetty is being killed
64+ if ( ! running ) {
65+ break ;
6266 }
6367
64- console . log ( `default shell ${ default_shell } exited with code ${ exit_code } ` ) ;
68+ term . reset ( ) ;
69+
70+ term . writeln ( exit_code === 0 ? "Logged out." : `Shell exited with code ${ exit_code } !` ) ;
71+ term . writeln ( `Press any key to log back in.${ ANSI . CURSOR . invisible } ` ) ;
72+
73+ await term . wait_for_keypress ( ) ;
74+ term . write ( ANSI . CURSOR . visible ) ;
75+
76+ term . reset ( ) ;
6577 }
6678
6779 return final_code ;
You can’t perform that action at this time.
0 commit comments