fix missing prompt on other ttys - #137
Conversation
|
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the command prompt was missing when switching between TTY screens. The fix ensures that when changing screens, a prompt is displayed if the cursor is at the beginning of a line, and prevents duplicate prompts from being printed.
- Added a call to
tty_print_prompt()when switching TTY screens - Modified
tty_print_prompt()to only print the prompt when the cursor is at column 0
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if (curr_tty->column != 0) | ||
| return; |
There was a problem hiding this comment.
The logic is inverted. The prompt should be printed when curr_tty->column == 0 (at the start of a line), but the current condition returns early when not at column 0, which means the prompt will only be printed when the cursor is NOT at the beginning of the line.
| if (curr_tty->column != 0) | |
| return; | |
| if (curr_tty->column == 0) | |
| tty_putstr(TTY_PROMPT); | |
| } |



No description provided.