Haskell runCommand in Windows

Viewed 614

As a simple exercise, I'm trying to change the prompt in Win7's Command Prompt window with the following little program:

module Main where
 import System.Environment
 import System.Process 

 p :: String -> String 
 p name = "Prompt " ++ name ++ "\r\n"

 main :: IO ()
 main = do
     putStrLn ("Give me a name:")
     name <- getLine
     putStrLn (p name)
     pid <- runCommand $ p name

Although it runs fine in the Command Prompt window, it does not actually change the prompt. Entering the same command on the command line by hand does change it. When I use "system" (which returns an exit code) rather than "runCommand" (which just returns a pid) it gives "ExitSuccess", but still doesn't change the prompt.

1 Answers
Related