Content-Length: 337813 | pFad | https://github.com/All-Hands-AI/OpenHands/pull/9959

92 Fix user input commands being echoed twice in terminal by erkinalp · Pull Request #9959 · All-Hands-AI/OpenHands · GitHub
Skip to content

Conversation

erkinalp
Copy link
Contributor

@erkinalp erkinalp commented Jul 29, 2025

  • This change is worth documenting at https://docs.all-hands.dev/
  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

End-user friendly description of the problem this fixes or functionality this introduces.

Fixed an issue where user-entered bash commands would appear twice in the terminal. Now, when you type a command in the terminal, it will only be displayed once, providing a cleaner and more consistent experience.


Summarize what the PR does, explaining any non-trivial design decisions.

This PR fixes a bug where user input bash commands were being echoed twice in the terminal:

  1. First as the user types it (expected behavior)
  2. Then again when the command is sent to the backend and added to the commands array

The solution modifies the renderCommand function in use-terminal.ts to skip rendering user input commands that have already been displayed as the user typed them. This is done by adding an isUserInput parameter to the function that, when true, will skip rendering commands of type "input".

Design decisions:

  • Added an optional parameter to the existing function rather than creating a new function to minimize changes
  • Used a simple type check to determine whether to render the command, making the solution straightforward and maintainable
  • Updated both initialization and update rendering paths to ensure consistent behavior

Link of any specific issues this addresses:

Fixes #6661

@erkinalp erkinalp marked this pull request as ready for review July 29, 2025 14:44
@erkinalp erkinalp requested review from amanape and rbren as code owners July 29, 2025 14:44
@erkinalp erkinalp changed the title Fix user input bash commands being echoed twice in terminal Fix user input commands being echoed twice in terminal Jul 29, 2025
@amanape amanape added the needs-qa This PR needs QA label Jul 29, 2025
@amanape amanape self-assigned this Jul 29, 2025
@Abubakar-01
Copy link
Collaborator

Reviewd the PR

Before ( Main branch ):
image

After ( PR Branch):
image

Conclusion: PR fixes the issue of input command being echoed twice in terminal

Copy link
Member

@amanape amanape left a comment

Choose a reason for hiding this comment

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

Thank you very much for closing this long standing issue!

@amanape amanape merged commit e348634 into All-Hands-AI:main Jul 30, 2025
23 checks passed
@erkinalp erkinalp deleted the fix-terminal-command-echo branch July 30, 2025 19:15
@erkinalp
Copy link
Contributor Author

@amanape there's lots of some such easy issues in the repo, i think those should be assigned to @openhands-agent where they are clear enough

@amanape
Copy link
Member

amanape commented Jul 31, 2025

That's true. If you find any problems that aren't in the GitHub issues, feel free to create them and tag OpenHands 😄

enyst pushed a commit that referenced this pull request Aug 15, 2025
Co-authored-by: openhands <openhands@all-hands.dev>
llamantino added a commit to llamantino/OpenHands that referenced this pull request Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa This PR needs QA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: User input bash commands get echoed back before it executes

4 participants









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/All-Hands-AI/OpenHands/pull/9959

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy