Skip to content

Windows CMD.EXE "Quick Edit Mode"

Behavior:

When a compiled haskell executable launches into a windows 7 cmd.exe terminal session, it does not respect the users quick edit mode setting, and launches with the system default setting instead.

I have not replicated this issue on other versions of windows.

Details: For a description of the feature behavior, see: https://blogs.msdn.microsoft.com/adioltean/2004/12/27/useful-copypaste-trick-in-cmd-exe/

The registry key entry controlling this setting is: HKEY_CURRENT_USER\Console\QuickEdit (1 == on, 0 ==off)

Tiny illustrative program:

main :: IO ()
main = putStrLn "Try to copy this text" >>=(\_ -> getLine) >>= putStrLn

Additional notes:

The workaround is pretty simple, launch the program from a .bat script -

cmd /K myscript.exe

Or from inside an existing cmd.exe session, and the problem goes away.

Edited by Tamar Christina
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information