43
votes
I force my shell prompt to the bottom of the screen
Is it just me, or is it weird that every terminal starts at the top-left? After three commands, your prompt stays at the bottom of the screen for the rest of the session anyway.
I added this to my fish_greeting last month. (You could add something similar to .bashrc / .zshrc):
printf "\033[$LINES;1H"
If you want to print a status line or two after this then subtract the number of extra lines:
printf '\033[%s;1H' (math $LINES - 1)
cat /proc/loadavg
It might take some getting used to but it feels a lot more natural. When opening a new window or pane, the prompt is always closer to the previous one so my eyes don't need to move as much.
It's a small subtle thing but I think it is an improvement. Return to teletype.
I once hacked my terminal to scroll the other way around. It's much better for your posture to look at the higher part of the screen most of the time.
That does sound even better! I wonder how hard this would be to do in a terminal and shell via OSC 133...
It looks like it is possible to some degree by just modifying the shell or the prompt:
Apparently Warp terminal has this option called input position, reverse order
I don't remember Warp having that option, but it's a long old time since I used OS/2. Still have the media here though. It was quite hard to install in a VM for a time, and now I don't even have the hardware to do that.
not OS/2! https://www.warp.dev/ :)
I don't miss OS/2 but I think about it a lot.
Haha, right! Man I loved OS/2. It wasn't that long ago it was still running a decent chunk of ATMs in the UK.
Also, cool terminal there. Mac version too, I'm trying it out now. Cheers!
Edit: that didn't last long. My Mac blocked a strange outbound connection then when I said I didn't want an account, it hung. Oh well.
oh yeah, that was absolutely not an endorsement of Warp --- I am ride or die with iterm2.
Wild that ATMs were running OS/2. ATMs are often well behind on software anyway, but that is waaaaaaay behind.
I'm trying to figure how this works with mine... I learn about the prompt every time I update it (which hasn't happened in ... dang, my timestamp got wrecked trying to implement this with
.bashrc. But I believe it's been at least 2-ish years based on the last custom timestamp).I tried a few options that wrecked the said backup timestamps apparently, and I can't figure how to implement something like this. I asked AI and didn't get any help... so any "once hacked" insights you'd like to share, I'd be greatly appreciative! (And, I would prefer to do them myself, as xk3 pointed out to each their own :)
I'm using Kitty and the custom bit I've implemented (heavily influenced/created by bashrcgenerator.com) is
I think you meant to reply to @GOTO10 but I'm curious about this too. The information on this page explains why it is not a simple thing to have done but I also don't want to discourage you from playing around!
However, my advice is this: use printf first instead of trying to get it right the first time. It's easier to run printf a bunch of times than it is to recover from a broken $PS1
I also use Kitty and I wonder if something like this wouldn't be possible to implement inside of a Kitty kitten. If not, it might be easier to hack a simpler terminal like st or foot
Yep, meant GOTO10 oops!
I haven't actually messed with my kitty.conf at all, though the kitten thing is interesting. I'll take a look at it!
This was a long time ago, we were bored in the office (remember those?), and just downloaded the source of a simple terminal and made it render the other way. It didn't take long, and should basically not have been much more than reversing a for loop somewhere. IIRC it got really funny with ncurses :) Also completely forgot about if afterwards, so I guess it wasn't a success, don't remember.
Generally speaking, my terminal will be full screen with decently large font, so I can actually read it, and a lot of the time it will be running some kind of ncurses based application such as vim or mc. I do understand the sentiment though. Part of my first job involved operating a telex machine for ordering, with one line of input and scrolling paper output. I can still remember the stupid telex address of that machine.
Anyway, I suppose the closest I get these days is on my corporate windows machine running VS-Code with its little terminal view open in a 6 line window at the bottom of the application.
that's pretty neat, actually. For ZSH...
edit: 1338's is better!
old:
printf '\033[%s;1H' $((LINES - 1))another edit: zsh4humans has
zstyle ':z4h:' prompt-at-bottom 'yes'if anybody uses that.Thank you, I used zsh and was about to be awake half the night looking for this…
Edit to add, I popped the following into my
~/.zshrc:clsis in there because I sometimes have a brain fart and type that instead.This works for me, at the top of my
~/.zshrcso there's no gap between my prompt and the commands in my rc. Having the -1 just causes it to miss a line, not sure if there's something weird about my terminal.printf "\033[$LINES;1H"Ah!
It's because I print a status line after the printf--(ie. cat /proc/loadavg) so that's why I need to subtract 1
but other people either don't need that or they'll want to subtract more if they print more than one informational lines
I will edit the OP to include this information
Very nice! Only issue I'm seeing is that if I resize the window, it doesn't move to the new "bottom". But not enough of a problem to stop me from using this. Thanks!
Return to teletype indeed. The first thing I thought about when I read this was that it reminded me of the interface to trebuchet and other chat type programs. I actually did at one time access a computer regularly with such an application due to the lack of terminal programs on public computers at the time.
I just realized that I'm doing it the same way, by virtue of this being the default in 'screen'. Back on the 8bits, there was a "command line" at the bottom, the rest of the screen was output.
Whenever I'm using the "naked" terminal without a 'screen', I'm mildly confused by the rolling cursor position.