Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion kernel/src/tty/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,14 @@ void tty_change_screen(size_t screen_number) {
curr_tty = &ttys[screen_number - 1];
memcpy(vga_buf, curr_tty->buf, VGA_BUFFER_SIZE);
tty_move_cursor(curr_tty->column, curr_tty->row);
tty_print_prompt();
}

void tty_print_prompt() { tty_putstr(TTY_PROMPT); }
void tty_print_prompt() {
if (curr_tty->column != 0)
return;
Comment on lines +108 to +109

Copilot AI Oct 14, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
if (curr_tty->column != 0)
return;
if (curr_tty->column == 0)
tty_putstr(TTY_PROMPT);
}

Copilot uses AI. Check for mistakes.
tty_putstr(TTY_PROMPT);
}

static void build_command(char* buf) {
size_t prompt_len = strlen(TTY_PROMPT);
Expand Down