File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,6 +103,10 @@ class Shell extends Adapter {
103103 this . #rl. prompt ( )
104104 break
105105 }
106+ if ( input . length === 0 ) {
107+ this . #rl. prompt ( )
108+ return
109+ }
106110 if ( input . length > 0 ) {
107111 this . #rl. history . push ( input )
108112 }
Original file line number Diff line number Diff line change @@ -75,6 +75,28 @@ describe('Shell Adapter Integration Test', () => {
7575 await new Promise ( resolve => setTimeout ( resolve , 60 ) )
7676 assert . deepEqual ( wasCalled , false )
7777 } )
78+ it ( 'shows prompt if only spaces were entered' , async ( ) => {
79+ let wasCalled = false
80+ robot . respond ( / .* / , async res => {
81+ wasCalled = true
82+ await res . reply ( 'hello from the other side' )
83+ } )
84+ robot . stdin . push ( ' \n' )
85+ robot . stdin . push ( null )
86+ await new Promise ( resolve => setTimeout ( resolve , 60 ) )
87+ assert . deepEqual ( wasCalled , false )
88+ } )
89+ it ( 'shows prompt if only tabs were entered' , async ( ) => {
90+ let wasCalled = false
91+ robot . respond ( / .* / , async res => {
92+ wasCalled = true
93+ await res . reply ( 'hello from the other side' )
94+ } )
95+ robot . stdin . push ( '\t\t\n' )
96+ robot . stdin . push ( null )
97+ await new Promise ( resolve => setTimeout ( resolve , 60 ) )
98+ assert . deepEqual ( wasCalled , false )
99+ } )
78100} )
79101
80102describe ( 'Shell Adapter' , ( ) => {
You can’t perform that action at this time.
0 commit comments