Shell: ^A moves cursor to the beginning of line

This commit is contained in:
Bananymous 2023-08-14 12:26:22 +03:00
parent 8c282a5d83
commit 2f298a1979
1 changed files with 5 additions and 0 deletions

View File

@ -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();