Skip to content

Commit ee21525

Browse files
save file
1 parent 9aa114e commit ee21525

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

utils/misc/nodejs-terminal/v3.0/nodejs-terminal-v3.0.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,11 @@
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);
@@ -620,6 +625,8 @@
620625
return;
621626
}
622627

628+
var term = tabs.cur.view.terminal.term;
629+
623630
term.writeln('');
624631
term.writeln.green('saving snapshot ...');
625632

@@ -654,6 +661,11 @@
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){
@@ -665,6 +677,8 @@
665677
return;
666678
}
667679

680+
var term = tabs.cur.view.terminal.term;
681+
668682
term.writeln('');
669683
term.writeln.green('loading snapshot ...');
670684

0 commit comments

Comments
 (0)