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

pipeline ignores shell initialization routines #5

Open
yunake opened this issue Jan 10, 2020 · 4 comments
Open

pipeline ignores shell initialization routines #5

yunake opened this issue Jan 10, 2020 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@yunake
Copy link

yunake commented Jan 10, 2020

Things like custom aliases and functions are not available in the pipeline.

This is what is problematic with current approach of hardcoding /bin/sh instead of using current shell. Not sure if the real shell can be used instead?

@codekitchen codekitchen added enhancement New feature or request help wanted Extra attention is needed labels Jan 10, 2020
@codekitchen
Copy link
Owner

Agreed that'd be a nice addition. Most common shells support the -c option that we need, so it should be possible to use the user's configured shell most of the time I think. We'd probably want to whitelist which shells we know that works with.

I think we'd have to make them login shells too in order to load user aliases/functions -- bash has the -l option for that, I think most other shells do too. I'm not aware of any poblems with that, other than it just taking longer for the shell to load up on each execution, but I'd have to test it a bit.

Tab completion wouldn't work with the custom aliases and functions, I think we're kind of stuck there with the current implementation.

@codekitchen
Copy link
Owner

I had a use-case for using a zsh feature today so I implemented using the shell specified in $SHELL instead of always /bin/sh. I haven't enabled login shell yet though, I still need to figure out how well that'll work, so I don't think custom functions and aliases will get read from config yet.

@codekitchen
Copy link
Owner

Whoops, I meant "interactive shell" everywhere that I said "login shell" above. I've tested using an interactive shell in bash, zsh and fish and everything seems to work well. So this will now allow using custom aliases and functions etc, though as I mentioned above it won't autocomplete them -- I really don't know how we could make that work without integrating pipeline directly into the shell itself (which I would love to see happen someday).

@codekitchen
Copy link
Owner

I celebrated too soon -- with further usage I'm seeing an intermittent issue with interactive shells and zsh (haven't tested other shells yet). Sometimes, but not always, it prints zsh: suspended (tty input) and then exits the pipeline process. I'm not sure why this is happening yet, but I'm going to back out this change for now.

@codekitchen codekitchen reopened this Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants