I’m stuck on Stage Multiple completions #WH6.
As suggested, I’m trying to use an external library to implement the command autocompletion feature. The library in question is the following: GitHub - chzyer/readline: Readline is a pure go(golang) implementation for GNU-Readline kind library.
After several management issues, probably due to the fact that this library works more like zsh than bash, I reached the point where, following the list of similar commands shown on the next line, in the case of this library, a selector is provided directly on this line, rather than replicating the behavior of bash, which for similar commands displays the possible “completers” on the next line and then displays the existing command on the next line, waiting for the user to add the correct command.
Here are my logs:
[tester::#WH6] Typed "xyz_"
[your-program] $ xyz_
[tester::#WH6] ✓ Prompt line matches "$ xyz_"
[tester::#WH6] Pressed "<TAB>" (expecting bell to ring)
[tester::#WH6] Pressed "<TAB>" (expecting autocomplete to "xyz_baz xyz_foo xyz_quz")
[tester::#WH6] ✓ Received bell
[your-program] xyz_baz xyz_foo xyz_quz
[tester::#WH6] ✓ Prompt line matches "xyz_baz xyz_foo xyz_quz"
[tester::#WH6] Didn't find expected line.
[tester::#WH6] Expected: "$ xyz_"
[tester::#WH6] Received: "" (no line received)
[tester::#WH6] Assertion failed.
[tester::#WH6] Test failed
So expected bash behavior:
$ xyz_
xyz_baz xyz_foo xyz_quz
$ xyz_
My shell behavior based on current readline library:
![]()
So far, I’ve already made changes to the original library code to ring the bell when autocompletion returns no results, which wasn’t supported in the original code: Fixed a small bug that prevented the terminal from playing Bell sound when a command's autocompletion was not found by h3r0cybersec · Pull Request #256 · chzyer/readline · GitHub , and modified the results to be returned in alphabetical order, which is also not handled directly by the library.
What should I do now? Am I doing something wrong? Because I don’t want to make any more changes to the original library and focus on the shell implementation.








