File tree Expand file tree Collapse file tree
utils/misc/nodejs-terminal/v3.0 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 612612
613613 menu_callback [ 'save-snapshot' ] = async function ( ) {
614614 console . log ( 'save-snapshot' ) ;
615+ if ( ! tabs . cur . view ) {
616+ log . red ( 'no active terminal' ) ;
617+ return ;
618+ }
619+
615620 var cwd = tabs . cur . view . terminal . shell . cwd ;
616621 var cwd_abs = tabs . cur . view . terminal . shell . cwd_abs ;
617622 console . log ( cwd_abs ) ;
620625 return ;
621626 }
622627
628+ var term = tabs . cur . view . terminal . term ;
629+
623630 term . writeln ( '' ) ;
624631 term . writeln . green ( 'saving snapshot ...' ) ;
625632
654661
655662 menu_callback [ 'load-snapshot' ] = async function ( ) {
656663 console . log ( 'load-snapshot' ) ;
664+ if ( ! tabs . cur . view ) {
665+ log . red ( 'no active terminal' ) ;
666+ return ;
667+ }
668+
657669 var cwd = tabs . cur . view . terminal . shell . cwd ;
658670
659671 if ( cwd === null ) {
665677 return ;
666678 }
667679
680+ var term = tabs . cur . view . terminal . term ;
681+
668682 term . writeln ( '' ) ;
669683 term . writeln . green ( 'loading snapshot ...' ) ;
670684
You can’t perform that action at this time.
0 commit comments