| 263 | } |
| 264 | |
| 265 | func (s *DevboxShell) shellRCOverrides(shellrc string) (extraEnv map[string]string, extraArgs []string) { |
| 266 | // Shells have different ways of overriding the shellrc, so we need to |
| 267 | // look at the name to know which env vars or args to set when launching the shell. |
| 268 | switch s.name { |
| 269 | case shBash: |
| 270 | extraArgs = []string{"--rcfile", shellescape.Quote(shellrc)} |
| 271 | case shZsh: |
| 272 | extraEnv = map[string]string{"ZDOTDIR": shellescape.Quote(filepath.Dir(shellrc))} |
| 273 | case shKsh, shPosix: |
| 274 | extraEnv = map[string]string{"ENV": shellescape.Quote(shellrc)} |
| 275 | case shFish: |
| 276 | extraArgs = []string{"-C", ". " + shellrc} |
| 277 | } |
| 278 | return extraEnv, extraArgs |
| 279 | } |
| 280 | |
| 281 | func (s *DevboxShell) writeDevboxShellrc() (path string, err error) { |
| 282 | // We need a temp dir (as opposed to a temp file) because zsh uses |