-
-
Notifications
You must be signed in to change notification settings - Fork 345
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
shell buitins have no effect when running an interactive parser with a custom readline implementation #1100
Comments
Otherwise aliases don't get expanded, as they are only on by default for interactive shells in Bash, and we follow POSIX shell and Bash options. Updates #1100.
Thanks for the report. Indeed cmd/gosh did not expand aliases by default, even though it should behave like an interactive shell. The commits above should have fixed that, although note that you will need to use the option like cmd/gosh does now. Can you clarify what you mean by
|
I'm glad it was a simple fix. My problem is that the parser.Interactive method only allows for very rudimentary forms of line editing. So I, and the two other (u-root) https://github.com/u-root/u-root/tree/main/cmds/core/gosh but the problem all of these implementations run into the issues I outlined above: aliases don't expand, I made a little test repo that shows the problem and gives a way clearer idea of what I am trying to do you can check it out here https://github.com/sweetbbak/ash/blob/main/cmd/readline/main.go, or you could quick install it with this if you want to see it first hand: go install github.com/sweetbbak/ash/cmd/readline@6615b6b5e7588118ecb081ceed14c8cc0c3aa864 but ultimately, I would like to implement edit: my apologies, I realized that |
for example, if I alias a command to something else:
and then if I run
ls
the alias isn't honored, it just runs thels
binary.This could be a result of the way I'm using this library, but I've tried every documented way to parse and run shell statements with my custom implementation of readline. This implementation is probably 3500 sloc at minimum and I can't fit it into the given
parser.Interactive
method.here is an example of the implementation:
is there some part of the API I am missing here, or is what is necessary to allow this not exposed and what could possibly be causing shell builtins not to work in this context?
exit
,read -r VARNAME
also doesn't work, butcd
,export
,pushd popd dirs
work just fine.edit:
upon doing some testing I see that alias also doesn't work with
gosh
either, so maybe this is a known issue.The text was updated successfully, but these errors were encountered: