Skip to content

bump haskeline dependency to one that supports ANSI terminals#6147

Merged
aryairani merged 2 commits intotrunkfrom
26-01-27-multiline-prompt
Jan 29, 2026
Merged

bump haskeline dependency to one that supports ANSI terminals#6147
aryairani merged 2 commits intotrunkfrom
26-01-27-multiline-prompt

Conversation

@mitchellwrosen
Copy link
Member

@mitchellwrosen mitchellwrosen commented Jan 28, 2026

Overview

Partially addresses #6119

This PR swaps our haskeline dependency to a different branch, where I've added support for ANSI terminals. Now we no longer fall back on the "dumb terminal" logic, which horizontally scrolls the input line when it becomes long, rather than rendering the input on multiple lines.

I accomplished this by first extracting out an interface from the existing terminfo-based implementation that doesn't depend on terminfo, then implementing a second instance of that interface using ANSI escape sequences instead, for moving the cursor around, clearing lines, etc.

I say this "partially" addresses #6119 because although I think it really improves the status quo, the prompt still seems to behave kind of... weirdly. I've seen it kind of get visually out of sync, where my cursor isn't where it appears to be, when moving around the wrapped line threshold, either by left/right arrow keys, or backspace. I observed the exact same behavior with the terminfo backend, so I think the logic in haskeline just kind of sucks and is woefully behind other languages' repl libraries in functionality and polish.

Test coverage

I tested this change manually and it seems to work

@mitchellwrosen
Copy link
Member Author

I can't seem to get CI to pass, weeder is failing with a million errors only on the ubuntu-24.04 build

@mitchellwrosen
Copy link
Member Author

@aryairani Any ideas? I've never seen this before

@mitchellwrosen
Copy link
Member Author

Nvm, restarted it enough times, apparently

@mitchellwrosen
Copy link
Member Author

Oh, no, I see what's happening. It is succeeding in push but failing in pull_request (still don't know why).

@mitchellwrosen
Copy link
Member Author

'k, merging in trunk seems like it did the trick

@mitchellwrosen mitchellwrosen marked this pull request as ready for review January 29, 2026 16:39
@aryairani
Copy link
Contributor

aryairani commented Jan 29, 2026

@mitchellwrosen I have some pending changes to CI that will hopefully improve a bunch of stuff, but there are still loose ends

the current draft also disables weeder but only because I don't understand what's going on with it

@aryairani aryairani merged commit 8379cea into trunk Jan 29, 2026
32 checks passed
@aryairani aryairani deleted the 26-01-27-multiline-prompt branch January 29, 2026 17:46
@mitchellwrosen
Copy link
Member Author

Belated screenshot

Screenshot 2026-01-29 at 1 18 05 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants