@@ -64,9 +64,12 @@ export async function init(ctx, info) {
6464 placeholder="/bin/bash"
6565 v-model="fields.executable"
6666 inputClass="input input--xs"
67- :grow
67+ :inline
6868 :required
6969 />
70+ <div class="inline-field grow">
71+ <label class="inline-input-label inline-status-label" data-el-status-label></label>
72+ </div>
7073 <button id="start-stop-button" @click="start_stop_executable" class="icon-button">
7174 <i class="ri ri-play-line" data-start-stop-button></i>
7275 </button>
@@ -83,6 +86,7 @@ export async function init(ctx, info) {
8386 const button = ctx . root . querySelector ( "[data-start-stop-button]" ) ;
8487 const classList = button . classList ;
8588 const terminalEl = ctx . root . querySelector ( '#terminal' ) ;
89+ const statusEl = ctx . root . querySelector ( "[data-el-status-label]" ) ;
8690 if ( classList . contains ( "ri-stop-line" ) ) {
8791 ctx . pushEvent ( "stop_executable" ) ;
8892 button . classList . remove ( "ri-stop-line" ) ;
@@ -109,6 +113,8 @@ export async function init(ctx, info) {
109113 term . clear ( )
110114 }
111115
116+ statusEl . innerText = `` ;
117+
112118 fit_addon . fit ( )
113119 resizeObserver = new ResizeObserver ( ( entries ) => {
114120 try {
@@ -150,6 +156,14 @@ export async function init(ctx, info) {
150156 term . write ( Uint8Array . from ( atob ( data ) , c => c . charCodeAt ( 0 ) ) )
151157 } )
152158
159+ ctx . handleEvent ( "executable_exited" , ( { code } ) => {
160+ const status = ctx . root . querySelector ( "[data-el-status-label]" ) ;
161+ status . innerText = `Process exited with code ${ code } ` ;
162+ const button = ctx . root . querySelector ( "[data-start-stop-button]" ) ;
163+ button . classList . remove ( "ri-stop-line" ) ;
164+ button . classList . add ( "ri-play-line" ) ;
165+ } )
166+
153167 ctx . handleSync ( ( ) => {
154168 // Synchronously invokes change listeners
155169 document . activeElement &&
0 commit comments