How to use the terminal-kit.terminal.clear function in terminal-kit

To help you get started, we’ve selected a few terminal-kit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / terminal-kit / terminal-kit-tests.ts View on Github external
"File",
  "Edit",
  "View",
  "History",
  "Bookmarks",
  "Tools",
  "Help"
];

const options = {
  y: 1, // the menu will be on the top of the terminal
  style: term.inverse,
  selectedStyle: term.dim.blue.bgGreen
};

term.clear();

term.singleLineMenu(items1, options, (error: any, response: any) => {
  term("\n").eraseLineAfter.green(
    "#%s selected: %s (%s,%s)\n",
    response.selectedIndex,
    response.selectedText,
    response.x,
    response.y
  );
});

term.cyan("The hall is spacious. Someone lighted few chandeliers.\n");
term.cyan("There are doorways south and west.\n");

const items2 = ["a. Go south", "b. Go west", "c. Go back to the street"];
github opendnd / dynastia / lib / program-render.js View on Github external
displayPerson = (err, res) => {
      term.clear();
      if (res.selectedIndex === Object.values(persons).length) process.exit();

      // grab the person and continue
      person = Object.values(persons)[res.selectedIndex];
      Renderer.outputPerson(person);
      term.white(Renderer.hr());
      const items = ['→ Export *.per', '← Back', '↵ Exit'];
      term.singleColumnMenu(items, displayPersonActions);
    };
github Automattic / wp-calypso / bin / analyze-css.js View on Github external
switch ( name ) {
		case 'BACKSPACE':
			const parentPath = path.dirname( current.path );

			if ( isProjectPath( parentPath ) ) {
				current = Folder( parentPath );

				render();
			} else {
				term.bell();
			}

			break;

		case 'ESCAPE':
			term.clear();
			term.processExit();

			break;
	}
} );
github cronvel / terminal-kit / sample / single-column-menu-todoc2.js View on Github external
The above copyright notice and this permission notice shall be included in all
	copies or substantial portions of the Software.

	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
	OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
	SOFTWARE.
*/
"use strict" ;

var term = require( 'terminal-kit' ).terminal ;

term.clear() ;
term.cyan( 'Where will you go?\n' ) ;

var items = [
	'a. Go north' ,
	'b. Go south' ,
	'c. Go east' ,
	'd. Go west'
] ;

var menu = term.singleColumnMenu( items , { continueOnSubmit: true } ) ;

menu.on( 'submit' , data => {
	term.saveCursor() ;
	term.moveTo( 1 , term.height - 1 , "Submit: %s" , data.selectedText ) ;
	term.restoreCursor() ;
} ) ;
github infinitered / ignite / src / lib / library / completeTemplate.js View on Github external
function drawTemplate(content) {
    term.clear()
    term(content)
    screen.draw()
  }