setup icon indicating copy to clipboard operation
setup copied to clipboard

Ensure .bashrc is run?

Open jhheider opened this issue 2 years ago • 6 comments

It seems like macOS bash doesn't read .bashrc out of .bash_profile by default: https://github.com/teaxyz/cli/issues/648

We should consider populating .bash_profile instead.

jhheider avatar Jul 27 '23 15:07 jhheider

Ugh, no: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

login shells and non-login shells run a disjoint set of files, unless .bash_profile calls .bashrc specifically. It seems beyond our scope to ensure that. :/

jhheider avatar Jul 27 '23 16:07 jhheider

we could add to both.

mxcl avatar Jul 27 '23 17:07 mxcl

I considered briefly. Might be ok, if we have enough traps. Seems wrong to run twice for most configurations.

jhheider avatar Jul 27 '23 17:07 jhheider

What a very weird and unlikable design choice.

jhheider avatar Jul 27 '23 17:07 jhheider

all the tests I've tried suggest running twice is safe. But it is an extra ~100ms per tea instantiation until we are rust.

mxcl avatar Jul 27 '23 17:07 mxcl

I mean, you can do:

  if [[ $TEA_HAS_RUN -ne 1 ]]; then
    tea --magic | do
    export TEA_HAS_RUN=1
  fi

jhheider avatar Jul 27 '23 17:07 jhheider