Follow

Command shell thoughts. Ever think about how when you start with a fresh shell, your cursor is at the top line. Then as you work, your focus moves down the screen until you're working on the last line. But you clear the screen and it starts over. You can see the legacy reason it does this (hardware terminals), but why does it still do this today? Why not have clear-screen reset to the bottom line?
alias clear='clear;tput cup $LINES 0'
If only I could get ^L to do this too.

· · Web · 2 · 0 · 2

FWIW, I've been using that alias for over 20 years. People I'm tutoring ask why I bother typing `clear` instead of using ^L. And I'm like, "Let me tell you a story." 😆

Show thread

@CarlCravens oh, that's clever.

on thinking about it, i don't know whether it would work better for me or not, but it's sort of striking that i never really thought about it until now.

@CarlCravens bindkey -s '^L' '^Uclear;tput cup $LINES 0^M'

If you're using zsh, which you might not be, but... should be doable in bash too :P

@jfred I'm too old for zsh. Newfangled shells are a young man's game.

@CarlCravens Out of curiosity I looked up when the first zsh release was... 31 years ago!

Honestly these days I mostly use it out of apathy, I already have to adjust to macOS for work and it's now the default there... still use bash on all my personal Linux machines

@jfred Weird how long it can take some things to get popular. But I'm not using a Mac, and I've been using Bash for so long and it does the job I want it to do, so I haven't bothered looking at changing.

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!