You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm playing around with terminal-kit and what I'm trying to do is to create a navigation. Once the users submits on a menu I want to rewrite everything and draw a new document. However the menu never gets removed from the screen.
you can use term.clear() or term.eraseDisplay() fo this things
Theres a code snippet for what you asked:
...
constmenuOptions={y: 1,style: term.inverse,selectedStyle: term.dim.blue.bgGreen,cancelable: true};functiondisplayMenu(){term.clear();term.singleLineMenu(menuItems,menuOptions,function(error,response){if(error){term.red.bold('Error: %s\n',error);process.exit(1);}if(response.canceled){term.red.bold('Menu canceled\n');process.exit();}// After selecting clear screen and write new contentterm.clear();switch(response.selectedText){case'Home':
term.green('Welcome to the Home page!\n');break;case'Settings':
term.yellow('Here are the Settings.\n');break;case'Profile':
term.blue('This is your Profile.\n');break;case'Exit':
term.red('Exiting...\n');process.exit();break;default:
term('Unknown selection.\n');break;}// after drawing new content return to the menusetTimeout(displayMenu,2000);// after 2 secs show menu});}// show first menudisplayMenu();
Hi, I'm playing around with terminal-kit and what I'm trying to do is to create a navigation. Once the users submits on a menu I want to rewrite everything and draw a new document. However the menu never gets removed from the screen.
https://github.com/juliuszfedyk/termigram
The text was updated successfully, but these errors were encountered: