Reputation: 71
For context: I think I pressed something wrong while writing a command, but didn't pay much attention, then I noticed that if I went back with the up-arrow key, and then used the down-arrow key, the previous commands where concatenated:
(It may be important to note that this only happens using GHCi --Glasgow Haskell Compiler interactive environment)
% ghci
GHCi, version 8.10.7: https://www.haskell.org/ghc/ :? for help
Prelude> x = 2
Prelude> y = 2
Prelude> x + y
4
Prelude> x + y = x = y = x +
The last line was "written" using only the arrow keys, after using them a few times, they can't be deleted, but if I actually write something after it, the previous commands are ignored: for reference:
{} - concatenated unintentionally with arrow keys
[] - written by me
Prelude> {x + y = x} [2 + 2]
4
^the above, if written only by me, without using arrow keys, would've thrown an error.
Any help is greatly appreciated.
Upvotes: 1
Views: 190
Reputation: 71
It turns that, quoting a member from the Function Programming Discord, "it's a known issue with haskeline (the library GHCi) uses that been fixed but needs to be back ported into GHC itself"
A workaround suggested by the same person is running TERM=dumb ghci
Upvotes: 1