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

Two ideas? #12

Open
v217 opened this issue Jun 22, 2020 · 4 comments
Open

Two ideas? #12

v217 opened this issue Jun 22, 2020 · 4 comments

Comments

@v217
Copy link

v217 commented Jun 22, 2020

Thank you for this great shell!
Two ideas:

  1. Why not add the option to use --shell=False for running system commands without a shell e.g. subprocess.run(... shell=False)
    The scripts would be more portable, faster and less error prone and best of all you can forget about all the shell idiosyncrasies like shell escaping etc ... and error handling would also be much easier.
  2. If you have fish installed it's easy too add fish completions as an option for system commands and arguments (for example the clojure shell does this):
    https://github.com/dundalek/closh/blob/master/resources/completion/completion.fish
    Adding this as an option would make this shell as convenient as fish!
@v217
Copy link
Author

v217 commented Jun 22, 2020

A workaround for the first point is
daudin --shell '/usr/bin/env -S'

Oh and I noticed that terminating a subprocess eg sleep 1000 with Ctrl+c does work for --shell='bash -c'
but does not work for
--shell='sh -c', --shell='fish -c' and --shell='env -S'
I think that's because bash parses the command and if there's only one command execve into the command and exits.

@v217
Copy link
Author

v217 commented Jun 22, 2020

I also came across this article, which maybe is also useful for daudin:
Zsh and Fish’s simple but clever trick for highlighting missing linefeeds

@v217
Copy link
Author

v217 commented Jun 22, 2020

Sorry for this sudden agglomeration of ideas.
I think in the long run it would be advantageous to factor out the non-interactive code. This would make it far easier to understand the code.

@v217 v217 changed the title ¿Two ideas? Two ideas? Jun 22, 2020
@terrycojones
Copy link
Owner

Hey @v217 - thanks for the comments, and definitely no need to apologize! :-) Right now I can't spend much time working on daudin but would like to. Anyway, I'm happy to chat and to think etc., and maybe will have time to work on small things (if I understand them!). Feel free to send pull requests if you want to & have time. Thanks for the nice comments. I don't think daudin is too far away from actually being usable, and I would like to try switching. But I use fish and would certainly miss the predictive text it adds to my command line based on previous commands.

BTW, daudin seems to sometimes screw up the terminal settings, which I need to dig into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants