-
Notifications
You must be signed in to change notification settings - Fork 3.9k
tools/bashreadline: Fix bashreadline #4903
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Could you give more details about how to reproduce |
bashreadline1.mp4bashreadline2.mp4 |
123166d
to
514013e
Compare
514013e
to
87ceeda
Compare
martinetd
added a commit
to martinetd/nixpkgs
that referenced
this pull request
Jul 21, 2024
- we didn't provide the newly required elfutils python dependency, but we're only dealing with newer bashes so just use the new symbol - while here also default to using our libreadline as bash is configured to use it on nixos; this can still be overriden Link: iovisor/bcc#4903 Fixes: NixOS#328743
dkruces
pushed a commit
to dkruces/bcc
that referenced
this pull request
Nov 28, 2024
This Pull Request fixes the issue where the bashreadline tool would lose the first bash command upon startup. At runtime, bash blocks at the readline function in bash::readline.c. Upon receiving the Enter key signal, it calls the readline_internal_teardown function to retrieve the user's input. Therefore, changing the hook function from readline to readline_internal_teardown resolves the issue of losing the first bash command after startup of bashreadline. The specific approach is to open the symbol table of bash and check if there is a symbol for readline_internal_teardown function. If not, continue to use the readline function as the hook position.
Mic92
pushed a commit
to NixOS/nixpkgs
that referenced
this pull request
Jan 19, 2025
- we didn't provide the newly required elfutils python dependency, but we're only dealing with newer bashes so just use the new symbol - while here also default to using our libreadline as bash is configured to use it on nixos; this can still be overriden Link: iovisor/bcc#4903 Fixes: #328743
dkruces
pushed a commit
to dkruces/bcc
that referenced
this pull request
Mar 18, 2025
This Pull Request fixes the issue where the bashreadline tool would lose the first bash command upon startup. At runtime, bash blocks at the readline function in bash::readline.c. Upon receiving the Enter key signal, it calls the readline_internal_teardown function to retrieve the user's input. Therefore, changing the hook function from readline to readline_internal_teardown resolves the issue of losing the first bash command after startup of bashreadline. The specific approach is to open the symbol table of bash and check if there is a symbol for readline_internal_teardown function. If not, continue to use the readline function as the hook position.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Pull Request fixes the issue where the bashreadline tool would lose the first bash command upon startup.
At runtime, bash blocks at the readline function in bash::readline.c. Upon receiving the Enter key signal, it calls the readline_internal_teardown function to retrieve the user's input. Therefore, changing the hook function from readline to readline_internal_teardown resolves the issue of losing the first bash command after startup of bashreadline.
The specific approach is to open the symbol table of bash and check if there is a symbol for readline_internal_teardown function. If not, continue to use the readline function as the hook position.