File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src-tauri/src/shell_manager Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -178,7 +178,11 @@ impl Shell {
178178 }
179179 }
180180 }
181- let size = channel. read_timeout ( & mut buf, false , Some ( Duration :: from_micros ( 5 ) ) ) ?;
181+ let size = match channel. read_timeout ( & mut buf, false , Some ( Duration :: from_micros ( 5 ) ) ) {
182+ Ok ( size) => size,
183+ Err ( libssh_rs:: Error :: TryAgain ) => 0 ,
184+ Err ( e) => return Err ( Error :: from ( e) ) ,
185+ } ;
182186 if size != 0 {
183187 if let Some ( callback) = self . callback . lock ( ) . unwrap ( ) . as_ref ( ) {
184188 callback. rx ( 0 , & buf[ ..size] ) ;
@@ -190,7 +194,12 @@ impl Shell {
190194 }
191195 }
192196 if !has_pty {
193- let size = channel. read_timeout ( & mut buf, true , Some ( Duration :: from_micros ( 5 ) ) ) ?;
197+ let size =
198+ match channel. read_timeout ( & mut buf, true , Some ( Duration :: from_micros ( 5 ) ) ) {
199+ Ok ( size) => size,
200+ Err ( libssh_rs:: Error :: TryAgain ) => 0 ,
201+ Err ( e) => return Err ( Error :: from ( e) ) ,
202+ } ;
194203 if size != 0 {
195204 if let Some ( callback) = self . callback . lock ( ) . unwrap ( ) . as_ref ( ) {
196205 callback. rx ( 1 , & buf[ ..size] ) ;
You can’t perform that action at this time.
0 commit comments