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

Getline support backspace #14037

Merged

Conversation

zhangwenjian111
Copy link
Contributor

@zhangwenjian111 zhangwenjian111 commented Oct 10, 2024

Summary

getline function support backspace, need work with apache/nuttx-apps#2664

Impact

None

Testing

sim,qemu,arm64

@github-actions github-actions bot added the Size: M The size of the change in this PR is medium label Oct 10, 2024
@nuttxpr
Copy link

nuttxpr commented Oct 10, 2024

[Experimental Bot, please feedback here]

This PR does not meet the NuttX requirements.

Here's why and how to improve it:

  • Summary is incomplete:

    • Missing "Why": Why is getline backspace support necessary? Is there a bug report or feature request driving this?
    • Missing "How": Provide a technical explanation of how you implemented backspace support within getline.
    • Link Issues/PRs: If this relates to existing issues in NuttX or NuttX Apps, provide the links.
  • Impact is too brief:

    • Even if there's no user-facing impact, you should confirm this explicitly for each category:
      • "No new features added."
      • "No changes to existing features."
      • "No changes to the build process."
      • ...and so on for all categories.
    • Consider unintended consequences: Could this change, even a seemingly small one, have unexpected side effects?
  • Testing is insufficient:

    • Provide details:
      • Which simulator? (e.g., qemu-system-arm, qemu-system-riscv64)
      • Specific ARM64 board and configuration used.
    • Show, don't tell: Include snippets of your testing logs demonstrating the problem before the change and the improvement after.
    • Test breadth: Did you test different input scenarios (long lines, special characters)? Did you test on real hardware if possible?

Example of an Improved Summary:

This PR addresses [Issue #] by adding backspace support to the getline function. Previously, backspace characters were treated as regular input, making line editing impossible. The implementation modifies the internal buffer handling of getline to correctly handle backspace characters, deleting the previous character and adjusting the cursor position.

@xiaoxiang781216 xiaoxiang781216 merged commit aec44de into apache:master Oct 10, 2024
37 checks passed
@TimJTi
Copy link
Contributor

TimJTi commented Oct 14, 2024

@xiaoxiang781216 @zhangwenjian111 Assuming my git bisect attempt was correct, this PR has broken the backspace on my setup (custom board, UART console, MiniCom terminal on via WSL on Windows 11) is no longer working and I can no longer delete characters.

Is there some other setting (or change of a setting) that is related to this?

@xiaoxiang781216
Copy link
Contributor

@xiaoxiang781216 @zhangwenjian111 Assuming my git bisect attempt was correct, this PR has broken the backspace on my setup (custom board, UART console, MiniCom terminal on via WSL on Windows 11) is no longer working and I can no longer delete characters.

Is there some other setting (or change of a setting) that is related to this?

do you update nsh too? apache/nuttx-apps#2664

@TimJTi
Copy link
Contributor

TimJTi commented Oct 15, 2024

do you update nsh too? apache/nuttx-apps#2664
I thought I had - but it seems not. I've had this before so I may need to reclone/refork the repo if this happens again.

HOWEVER - perhaps this PR could have mentioned in the IMPACT section that nsh would be broken without updating to the latest nuttx-apps?

@xiaoxiang781216
Copy link
Contributor

update, thanks.

anchao added a commit to anchao/nuttx-apps that referenced this pull request Jan 22, 2025
ASCII_DEL will unable to handle after below change:
apache/nuttx#14037

| commit df5c876932c4c82e8aee32adca651bb99d9d6200
| Author: zhangwenjian <[email protected]>
| Date:   Thu May 23 13:13:48 2024 +0800
|
|     libc:getline support backspace
|
|     Signed-off-by: zhangwenjian <[email protected]>

remove canonical input mode to support backspace in cu

Signed-off-by: chao an <[email protected]>
@anchao
Copy link
Contributor

anchao commented Jan 22, 2025

@xiaoxiang781216 @zhangwenjian111 regression on cu command, here is fix:
apache/nuttx-apps#2968

xiaoxiang781216 pushed a commit to apache/nuttx-apps that referenced this pull request Jan 23, 2025
ASCII_DEL will unable to handle after below change:
apache/nuttx#14037

| commit df5c876932c4c82e8aee32adca651bb99d9d6200
| Author: zhangwenjian <[email protected]>
| Date:   Thu May 23 13:13:48 2024 +0800
|
|     libc:getline support backspace
|
|     Signed-off-by: zhangwenjian <[email protected]>

remove canonical input mode to support backspace in cu

Signed-off-by: chao an <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: M The size of the change in this PR is medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants