Q: read line until ESC button in pressed in haskell I need to real lines until ESC button is pressed. How can I check it?
lines
   = do
      line <- getLine
      if (== "/ESC") --this condition is wrong
         then ...
         else do
            ln <- lines
            return ...

Could anybody fix my problem?

A: The correct way to escape is with a backslash, the character is '\ESC', so the condition would be
if line == "\ESC"

But I'm not sure every terminal passes an '\ESC' through to the application.
If you want to stop immediately when the ESC key is pressed, something along the lines of
module Main (main) where

import System.IO

main :: IO ()
main = do
    hSetBuffering stdin NoBuffering
    getUntilEsc ""

getUntilEsc :: String -> IO ()
getUntilEsc acc = do
    c <- getChar
    case c of
      '\ESC' -> return ()
      '\n' -> do putStrLn $ "You entered " ++ reverse acc
                 getUntilEsc ""
      _ -> getUntilEsc (c:acc)

is what you need. You have to read character-wise, and you need to turn off the buffering of stdin, so the characters are immediately available for reading, and not only after a newline has been entered.
Note that on Windows turning off buffering didn't work. I don't know if this has been fixed recently.
Also, as @Daniel Wagner reported, it may well be that the Windows command prompt doesn't pass the ESC to the application.
