Shell: ^A moves cursor to the beginning of line
This commit is contained in:
@@ -616,6 +616,11 @@ int main(int argc, char** argv)
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case '\x01': // ^A
|
||||||
|
col = 0;
|
||||||
|
fprintf(stdout, "\e[%dG", prompt_length() + 1);
|
||||||
|
fflush(stdout);
|
||||||
|
break;
|
||||||
case '\x03': // ^C
|
case '\x03': // ^C
|
||||||
fputc('\n', stdout);
|
fputc('\n', stdout);
|
||||||
print_prompt();
|
print_prompt();
|
||||||
|
|||||||
Reference in New Issue
Block a user