Settings

Theme

Ask HN: Shell config is crazy complicated. Any solutions?

3 points by valty 2 years ago · 3 comments · 1 min read


There are so many config files that are read in a particular order for each shell, interactive vs login, and for each platform. They all configure themselves using env vars and shell functions. Then every dev tool pastes some config into some of these config files.

It's really out of control.

The shell is probably the most used software on a developer's computer and it's a total mess.

Are there any solutions to this?

xyzzy_plugh 2 years ago

It's not really out of control or complicated at all.

> Then every dev tool pastes some config into some of these config files.

This is why you see it to be complicated. Don't do this. The only thing you should really ever be editing is $PATH, and even then I'd argue not to. Do something else. Use direnv, source .env files, write wrapper scripts.

I don't put arbitrary shit into shell profiles or shell rc files, you're just asking for pain.

You should understand what you're doing before pasting arbitrary bits into these files.

  • icedchai 2 years ago

    Same. I usually keep an "env.sh" or similar inside each project directory and source that manually. I don't want a bunch of crap in my default shell environment.

stop50 2 years ago

I split my shell config into 2 stages: common things and local ones. in the common i set up the plugin manager and other things. In the local i set config fpr the tools

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection