Anonymous avatar Anonymous committed 8ab8e24

added ^u and ^w

Comments (0)

Files changed (1)

 int main(int argc, char **argv)
 {
 	int mfd, rdlen, i;
+	char word_separators[] = " \t~!@#$%^&*-+=\\|/?.,><";
 	fd_set rd;
 	struct termios set;
 
 					my_write(mfd, usrbuf, pos);
 					pos = 0;
 					break;
-				case '\b':
-				case 127 :
+				case '\b' :
+				case 0x7f :
 					pos -= (pos > 1) ? 2 : 1;
 					break;
+				case 0x15 : // Control-u
+					pos = 0;
+					break;
+				case 0x17 :
+					for (i = pos - 2; i >= 0 && strchr(word_separators, usrbuf[i]); i--)
+					    ;
+					for (i = MAX(i, 0); i >=0 && !strchr(word_separators, usrbuf[i]); i--)
+					    ;
+					pos = i + 1;
+					break;
 			}
 			print_usr();
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.