File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1+ module . exports = ( ) => {
2+ debug ( "Ctrl+Alt+Del pressed, rebooting" ) ;
3+ $$ . machine . reboot ( ) ;
4+ }
Original file line number Diff line number Diff line change @@ -27,6 +27,15 @@ exports.clear = printer.clear;
2727
2828let isReading = false ;
2929
30+ function listenCtrlAltDel ( keyinfo ) {
31+ if ( keyinfo . type === "kpdel"
32+ && keyinfo . ctrl
33+ && keyinfo . alt ) {
34+ require ( "./ctrlaltdel.js" ) ( ) ;
35+ }
36+ }
37+ keyboard . onKeydown . add ( listenCtrlAltDel ) ;
38+
3039exports . read = ( cb ) => {
3140 if ( isReading ) {
3241 throw new Error ( 'nested terminal read is not allowed' ) ;
Original file line number Diff line number Diff line change @@ -79,11 +79,11 @@ const cmds = {
7979 'description' : 'Show this message or show usage of the command =)' ,
8080 'usage' : 'help <command> |OR| help |OR| help -p[=n] |OR| help --page[=n]' ,
8181 run ( _args , f , res ) {
82- let args = _args . trim ( ) . split ( / \s + / ) ;
82+ let args = _args . trim ( ) . split ( / ( \s + ) / ) . filter ( i => i . trim ( ) . length > 0 ) ;
8383
84- if ( ! args || args [ 0 ] . startsWith ( "-p" ) || args [ 0 ] . startsWith ( "--page" ) ) {
85- let tmp_page = args [ 0 ] . slice ( 3 + 4 * Number ( args [ 0 ] . startsWith ( "--page" ) ) ) - 1 || 0 ;
86- if ( tmp_page == - 1 ) tmp_page = 0 ;
84+ if ( args . length === 0 || args [ 0 ] . startsWith ( "-p" ) || args [ 0 ] . startsWith ( "--page" ) ) {
85+ if ( ! args . length ) args = [ "-p=1" ] ;
86+ const tmp_page = args [ 0 ] . slice ( 3 + 4 * Number ( args [ 0 ] . startsWith ( "--page" ) ) ) - 1 ;
8787 const height = HEIGHT - 4 ;
8888 const commandList = Array . from ( processor . getCommands ( ) ) . sort ( ) ;
8989 if ( tmp_page < 0 || tmp_page + 1 > Math . ceil ( commandList . length / height ) ) {
You can’t perform that action at this time.
0 commit comments