module Procex.Shell (promptFunction, initInteractive) where
import System.IO
import System.Posix.Directory
import System.Posix.Env
promptFunction :: [String] -> Int -> IO String
promptFunction :: [String] -> Int -> IO String
promptFunction [String]
_modules Int
_line = do
String
d <- String -> String -> IO String
getEnvDefault String
"PWD" String
""
String -> IO ()
changeWorkingDirectory String
d
String -> IO String
forall (f :: * -> *) a. Applicative f => a -> f a
pure (String -> IO String) -> String -> IO String
forall a b. (a -> b) -> a -> b
$ String
d String -> String -> String
forall a. Semigroup a => a -> a -> a
<> String
": "
initInteractive :: IO ()
initInteractive :: IO ()
initInteractive = Handle -> BufferMode -> IO ()
hSetBuffering Handle
stdin BufferMode
LineBuffering