r/Clojure • • Nov 01 '17

Closh: bash + ClojureScript shell scripting!

https://github.com/dundalek/closh/blob/master/doc/guide.md#examples
75 Upvotes

15 comments sorted by

View all comments

7

u/kloudex Nov 01 '17

Author here, thanks for posting. The project is still very early in the development and there is a lot of work to be done to make it ready for daily use.

I would appreciate any feedback. What are the less known features of existing shells you really like? What things would you change about existing shells if you could?

4

u/Borkdude Nov 01 '17

Non-interactive mode (script) would be awesome. https://github.com/dundalek/closh/issues/2

1

u/tym0 Nov 01 '17

Could use lumo directly for that, no?

3

u/Borkdude Nov 01 '17

lumo does not provide the bash-like stuff

3

u/yogthos Nov 01 '17

Closh is looking pretty awesome already, the way it mixes shell syntax and s-exps looks seamless to me. A couple of things I really like in fish are the highlighting and contextual autocompletion.

1

u/Borkdude Nov 01 '17

How do you set an (environment) variable?

2

u/kloudex Nov 01 '17

As a workaround for now you can do (aset js/process.env "NAME" value)

1

u/LettuceKills Nov 02 '17

The "replace syntax with commands" thinking of fish is what I like the most about it, but that is baked into closh by it being a LISP. Another really great thing in fish is the auto-completion (triggered by the tab key) with the highlight-selection and columned options.

1

u/WalterGR Nov 02 '17

The "replace syntax with commands" thinking of fish

Could you give an example of this? I'm not a fish user but I'm curious about it.

1

u/LettuceKills Nov 03 '17 edited Nov 03 '17

For example, instead of using the special = operator to set variables the set command is used. So PATH=/usr/bin in bash is equivalent to set PATH /usr/bin in fish, where set is just another command.

1

u/LettuceKills Nov 03 '17 edited Nov 03 '17

Was forced to work with bash again today and more things I love about fish came to mind:

  • Highly usable and thought-out Out-of-the-box configuration: This is amazing when you have to hop between servers you don't maintain yourself

  • Amazing autocompletion: fish autocompletion is really next-level, it parses the man page of the command being used, and somehow fetches bunch of relevant information - for an example git branch names. This saves so much time and prevents a lot of frustration.

  • Auto-indentation for multi-line shell commands

  • Vim keybindings option: When you know these keybindings they can really speed things up