Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app/system/vi: Fix broken VI editor #2769

Merged
merged 2 commits into from
Oct 28, 2024
Merged

app/system/vi: Fix broken VI editor #2769

merged 2 commits into from
Oct 28, 2024

Conversation

bl4kraven
Copy link
Contributor

Summary

  1. Since Nuttx commit apache/nuttx@df5c876 , the serial driver enable ICANON flag as default. This broken the VI and all keystrokes inputs are buffered. So disable it in termcurses.

  2. If the VI exits in an error condition it will break the console. This is because release_vi was not called to restore the console configuration, so fix it.

Impact

All VI-enabled boards.

Testing

Test in Ubuntu 24.20 use sim:nsh.

@nuttxpr
Copy link

nuttxpr commented Oct 25, 2024

[Experimental Bot, please feedback here]

The PR summary you provided lacks some key details to determine if it meets the NuttX requirements. Here's a breakdown and what needs improvement:

Strengths:

  • Clear problem statements: Both points in the summary clearly identify the issue being addressed.
  • Impact is addressed: It broadly identifies affected boards.

Weaknesses:

  • Missing details about the change itself:
    • The summary only describes the problem not the solution. How exactly are you disabling ICANON in termcurses? What code is modified?
    • How is release_vi being incorporated to fix the error condition exit?
  • Impact section is too vague:
    • "All VI-enabled boards" is not specific enough. Which architectures? Are there known boards where this won't be an issue?
    • The other impact categories are completely skipped. At minimum, address:
      • Build: Did the build process change at all due to your modifications?
      • Documentation: Does this fix require any documentation updates?
  • Testing is insufficient:
    • Only one host/target combination: NuttX supports a wide range of platforms. Testing on a single simulated environment is not enough.
    • No logs provided: The "Testing logs" sections are empty, making it impossible to verify the fix.

To meet NuttX requirements, the PR needs these improvements:

  1. Elaborate on the solution: Don't just describe the problem. Explain the code changes made to implement the fix.
  2. Be specific about impact: List affected architectures and, if possible, any boards known to be unaffected. Address all other impact categories.
  3. Expand testing:
    • Test on at least one more significantly different target (e.g., a real board if you initially tested on simulator).
    • Include relevant logs: Show output before and after your change to demonstrate the fix.

By addressing these points, the PR will be much stronger and more likely to be accepted.

@bl4kraven
Copy link
Contributor Author

OK thanks, i fix it.

@xiaoxiang781216
Copy link
Contributor

@bl4kraven please fix the following style error:

Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/system/termcurses/tcurses_vt100.c:1549:83: error: Long line found

@bl4kraven
Copy link
Contributor Author

OK, It's already fixed.

Copy link

@cederom cederom left a comment

Choose a reason for hiding this comment

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

Error: /home/runner/work/nuttx-apps/nuttx-apps/apps/system/termcurses/tcurses_vt100.c:1549:46: error: Dangling whitespace at the end of line
Error: Process completed with exit code 1.

The ICANON flag broken VI key input, so disable it.

Signed-off-by: Leo Chung <[email protected]>
If VI exit without vi_release, that broken console.

Signed-off-by: Leo Chung <[email protected]>
@bl4kraven
Copy link
Contributor Author

OK, It's already fixed.

Copy link

@cederom cederom left a comment

Choose a reason for hiding this comment

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

Perfect! Thank you @bl4kraven :-)

@acassis acassis merged commit c7a905e into apache:master Oct 28, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants