Skip to content

fix missing prompt on other ttys - #137

Merged
Neffi42 merged 1 commit into
mainfrom
fix-prompt
Oct 14, 2025
Merged

Neffi42 merged 1 commit into
mainfrom
fix-prompt

Conversation

@Neffi42

@Neffi42 Neffi42 commented Oct 14, 2025

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings October 14, 2025 14:42
@Neffi42
Neffi42 requested a review from iamantoinev as a code owner October 14, 2025 14:42
@Neffi42 Neffi42 self-assigned this Oct 14, 2025
@Neffi42
Neffi42 enabled auto-merge (squash) October 14, 2025 14:43
@sonarqubecloud

Copy link
Copy Markdown

@Neffi42
Neffi42 merged commit 215d172 into main Oct 14, 2025
4 checks passed
@Neffi42
Neffi42 deleted the fix-prompt branch October 14, 2025 14:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread kernel/src/tty/tty.c
Comment on lines +108 to +109
if (curr_tty->column != 0)
return;

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants