mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-31 15:43:01 +00:00 
			
		
		
		
	Change Ctrl-C and move old behavior to Ctrl-Q
This lets Janet be a better unix citizen and lets Ctrl-C raise an interrupt. Trying to make Janet behave superficially like a shell by overriding Ctrl-C is not helpful.
This commit is contained in:
		| @@ -2,6 +2,8 @@ | ||||
| All notable changes to this project will be documented in this file. | ||||
|  | ||||
| ## Unreleased - ??? | ||||
| - Change repl behavior to make Ctrl-C raise SIGINT on posix. The old behavior for Ctrl-C, | ||||
|   to clear the current line buffer, has been moved to Ctrl-Q. | ||||
| - Importing modules that start with `/` is now the only way to import from project root. | ||||
|   Before, this would import from / on disk. | ||||
| - Change hash function for numbers. | ||||
|   | ||||
							
								
								
									
										8
									
								
								janet.1
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								janet.1
									
									
									
									
									
								
							| @@ -64,6 +64,10 @@ Move cursor to the beginning of input line. | ||||
| .BR Ctrl\-B | ||||
| Move cursor one character to the left. | ||||
|  | ||||
| .TP 16 | ||||
| .BR Ctrl\-D | ||||
| If on a newline, indicate end of stream and exit the repl. | ||||
|  | ||||
| .TP 16 | ||||
| .BR Ctrl\-E | ||||
| Move cursor to the end of input line. | ||||
| @@ -100,6 +104,10 @@ Delete one word before the cursor. | ||||
| .BR Ctrl\-G | ||||
| Show documentation for the current symbol under the cursor. | ||||
|  | ||||
| .TP 16 | ||||
| .BR Ctrl\-Q | ||||
| Clear the current command, including already typed lines. | ||||
|  | ||||
| .TP 16 | ||||
| .BR Alt\-B/Alt\-F | ||||
| Move cursor backwards and forwards one word. | ||||
|   | ||||
| @@ -758,6 +758,10 @@ static int line() { | ||||
|                 kleft(); | ||||
|                 break; | ||||
|             case 3:     /* ctrl-c */ | ||||
|                 clearlines(); | ||||
|                 gbl_sigint_flag = 1; | ||||
|                 return -1; | ||||
|             case 17:    /* ctrl-q */ | ||||
|                 gbl_cancel_current_repl_form = 1; | ||||
|                 clearlines(); | ||||
|                 return -1; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose