Closed stew closed 1 year ago
We might have something in haskell line we can use.
I don't think there's a platform-independent way to clear the screen, it's a terminal-specific thing.
e.g. In Terminal.app, you can clear the screen with Cmd-K (clears scrollback) or Ctrl-Cmd-L (preserves scrollback).
/usr/bin/clear
uses the terminfo database to figure out how.
Does Ctrl+L work for you in ucm currently outside of tmux
?
I'm surprised that there's not a tmux
command for clearing the buffer? At least, I haven't been able to find one that worked.
We could try clearing the screen with ANSI commands since we're already using ANSI commands.
clearing the screen with ANSI is what I would do echo -e '\033[2J'
should do it.
If there is a way to detect the screen height, you can just emit that many blank lines.
I suppose we could do something like less -cEFf /dev/null
since we require less, but that seems extra janky
Copy of my response on Discord, for those looking for how to make ctrl-l
keybindings to work in ucm
.
Since
ucm
useshaskeline
under the hood, one can just define custom keybindings in~/.haskeline
config file (path on my Linux system).Configuration is global, and would be used in
ghci
too, if you happen to write Haskell.So here's how
ctrl-l
keybinding defined in the config:bind: ctrl-l c l e a r return
Spaces between
c l e a r
characters are intentional, so keep them.For more customization see Haskeline Wiki.
It would be nice to have a
clear
command that would clear the screen similar to the familar /usr/bin/clearBonus points for making Ctrl+l work