Skip to content

Handle multiline input in GHCi history

GHCi accepts multiline input in the form of:

Prelude> :{
Prelude|   let f = do
Prelude|         print "Hello"
Prelude|         print "World"
Prelude|   :}

OR of the form:

Prelude> :set +m
Prelude|   let f = do
Prelude|             print "Hello"
Prelude|             print "World"
Prelude|   
Prelude>

However, recalling mulitline input from history (with the <Up> key or <C-p>) recalls it as its individual lines, not the whole input. Ideally multiline should be one history entry and allow proper editing of the recalled text.

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