when doing a history search (^R), restore old input line on
abortion (^G – ^C is SIGINT and doesn’t work like this, but that’s actually good IMO) prompted by enquiry about the Emacs editing mode by <smultron:#MidnightBSD>
This commit is contained in:
		
							
								
								
									
										4
									
								
								check.t
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								check.t
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| # $MirOS: src/bin/mksh/check.t,v 1.231 2008/10/15 10:24:59 tg Exp $ | # $MirOS: src/bin/mksh/check.t,v 1.232 2008/10/19 20:15:42 tg Exp $ | ||||||
| # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ | # $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $ | ||||||
| # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ | # $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $ | ||||||
| # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ | # $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $ | ||||||
| @@ -7,7 +7,7 @@ | |||||||
| # http://www.research.att.com/~gsf/public/ifs.sh | # http://www.research.att.com/~gsf/public/ifs.sh | ||||||
|  |  | ||||||
| expected-stdout: | expected-stdout: | ||||||
| 	@(#)MIRBSD KSH R35 2008/10/15 | 	@(#)MIRBSD KSH R35 2008/10/19 | ||||||
| description: | description: | ||||||
| 	Check version of shell. | 	Check version of shell. | ||||||
| stdin: | stdin: | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								edit.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								edit.c
									
									
									
									
									
								
							| @@ -5,7 +5,7 @@ | |||||||
|  |  | ||||||
| #include "sh.h" | #include "sh.h" | ||||||
|  |  | ||||||
| __RCSID("$MirOS: src/bin/mksh/edit.c,v 1.138 2008/10/13 23:06:02 tg Exp $"); | __RCSID("$MirOS: src/bin/mksh/edit.c,v 1.139 2008/10/19 20:15:43 tg Exp $"); | ||||||
|  |  | ||||||
| /* tty driver characters we are interested in */ | /* tty driver characters we are interested in */ | ||||||
| typedef struct { | typedef struct { | ||||||
| @@ -2202,6 +2202,10 @@ x_search_hist(int c) | |||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 			offset = x_search(pat, 0, offset); | 			offset = x_search(pat, 0, offset); | ||||||
|  | 		} else if (f == XFUNC_abort) { | ||||||
|  | 			if (offset >= 0) | ||||||
|  | 				x_load_hist(histptr + 1); | ||||||
|  | 			break; | ||||||
| 		} else { /* other command */ | 		} else { /* other command */ | ||||||
| 			x_e_ungetc(c); | 			x_e_ungetc(c); | ||||||
| 			break; | 			break; | ||||||
|   | |||||||
							
								
								
									
										7
									
								
								mksh.1
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								mksh.1
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| .\" $MirOS: src/bin/mksh/mksh.1,v 1.140 2008/10/04 23:22:13 tg Exp $ | .\" $MirOS: src/bin/mksh/mksh.1,v 1.141 2008/10/19 20:15:44 tg Exp $ | ||||||
| .\" $OpenBSD: ksh.1,v 1.122 2008/05/17 23:31:52 sobrado Exp $ | .\" $OpenBSD: ksh.1,v 1.122 2008/05/17 23:31:52 sobrado Exp $ | ||||||
| .\"- | .\"- | ||||||
| .\" Try to make GNU groff and AT&T nroff more compatible | .\" Try to make GNU groff and AT&T nroff more compatible | ||||||
| @@ -30,7 +30,7 @@ | |||||||
| .el .xD \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 | .el .xD \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 | ||||||
| .. | .. | ||||||
| .\"- | .\"- | ||||||
| .Dd $Mdocdate: October 4 2008 $ | .Dd $Mdocdate: October 19 2008 $ | ||||||
| .Dt MKSH 1 | .Dt MKSH 1 | ||||||
| .Os MirBSD | .Os MirBSD | ||||||
| .Sh NAME | .Sh NAME | ||||||
| @@ -4840,6 +4840,9 @@ followed by a | |||||||
| or | or | ||||||
| .Ic prefix\-2 | .Ic prefix\-2 | ||||||
| key will be executed after leaving search mode. | key will be executed after leaving search mode. | ||||||
|  | The | ||||||
|  | .Ic abort Pq \*(haG | ||||||
|  | command will restore the input line before search started. | ||||||
| Successive | Successive | ||||||
| .Ic search\-history | .Ic search\-history | ||||||
| commands continue searching backward to the next previous occurrence of the | commands continue searching backward to the next previous occurrence of the | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								sh.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								sh.h
									
									
									
									
									
								
							| @@ -100,9 +100,9 @@ | |||||||
| #define __SCCSID(x)	__IDSTRING(sccsid,x) | #define __SCCSID(x)	__IDSTRING(sccsid,x) | ||||||
|  |  | ||||||
| #ifdef EXTERN | #ifdef EXTERN | ||||||
| __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.241 2008/10/15 10:25:01 tg Exp $"); | __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.242 2008/10/19 20:15:45 tg Exp $"); | ||||||
| #endif | #endif | ||||||
| #define MKSH_VERSION "R35 2008/10/15" | #define MKSH_VERSION "R35 2008/10/19" | ||||||
|  |  | ||||||
| #ifndef MKSH_INCLUDES_ONLY | #ifndef MKSH_INCLUDES_ONLY | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user