Gabriella439 / turtle

Shell programming, Haskell style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to override default shell

adrian-gierakowski opened this issue · comments

The shell function doesn't seem to respect the $SHELL env var or my current users default shell, it always runs /bin/sh. Fox example, running:

#! /usr/bin/env nix-shell
#! nix-shell -i runghc -p "ghc.withPackages (x: [ x.turtle ])"

{-# LANGUAGE OverloadedStrings #-}

import Turtle

main = do
  shell "echo $SHELL" empty
  shell "dscl . -read ~/ UserShell" empty
  shell "echo $0" empty

prints the following:

/nix/store/7b6xw0kh049s12j2sqbhdv3n6ma11c91-bash-interactive-4.4-p23/bin/bash
UserShell: /usr/local/bin/fish
/bin/sh

Do you know how the underlying System.Process.shell determines which shell to use?

@adrian-gierakowski: I believe it is hard-coded in Haskell's process library (which is what turtle uses under the hood). So if you think it should respect $SHELL then you might need to open an issue against that package