romkatv / zsh4humans

A turnkey configuration for Zsh
MIT License
1.81k stars 116 forks source link

[Question] Why is prompt-at-bottom the default behavior? #246

Closed ccelik97 closed 1 year ago

ccelik97 commented 1 year ago

First of all I'm aware that I can disable it by setting it to no.

But I'd like to learn a bit more about your reasoning behind why you prefer the prompt to start at the bottom (beyond the fact that it's position stays more or less pre-determined this way, even though entering multi-line commands moves the previous lines of the command line up).

The reason why I have this question is in literally every modern shell prompt the input cursor goes from top to bottom of the screen as the terminal window is filled with more and more input & output logs. And in fact the conventional way makes sense when I open a new terminal window on a computer with a keyboard & mouse, in an interface with window titles & tabs on top so I don't have to look at both top & bottom of the screen/window to know what's going on. So when I noticed that it's at the bottom on your setup I was surprised lol.

By the way, even though I may not prefer it that way on a desktop computer/laptop etc, I still thank you for making me think about it as for example on my phone etc on handheld, touch screens I'd appreciate having it at the bottom which is where I've gotten used to have the message boxes in the chatting apps: Right above the software/on-screen keyboard anyway. But I kinda doubt this was behind your reasoning on preferring to have it at the bottom so,

Why do you prefer your terminal prompt to be at the bottom of your screen from the get-go?

romkatv commented 1 year ago

Why is prompt-at-bottom the default behavior?

Only if you enable tmux. Most users don't enable it, so the default is prompt at the top.

I've just pushed a commit that explicitly sets prompt-at-bottom to no if you choose to enable tmux in the installer.

Having prompt at bottom is objectively better but unfortunately having objectively good defaults causes way too many questions from new users so I have to make the defaults suboptimal and then allow those who care to undo the damage. There are many other features of this nature in zsh4humans.

Why do you prefer your terminal prompt to be at the bottom of your screen from the get-go?

By having prompt at bottom you have all most important information always displayed in the same place:

You don't have to scan the screen to find the most important information because it's always at the bottom. You can position your terminal window so that it's most convenient for you to look at that place.

If prompt starts at the top, it'll eventually drop to the bottom and stay there anyway. The only advantage of starting at the top is to avoid surprising new users.

in literally every modern shell prompt the input cursor goes from top to bottom

Because it's the only UI that is possible to implement on top of TTY. zsh4humans does the "impossible" thing by extending the capability of TTY with two extra operations: save screen and restore screen.

on my phone etc on handheld, touch screens I'd appreciate having it at the bottom

Also note how the most important information (what you are typing and the last messages) are displayed close to each other.

ccelik97 commented 1 year ago

Having prompt at bottom is objectively better

I guess what you say makes some sense from your perspective but I really had a "I beg to differ" moment when I first saw you say that in some older issue here with so much confidence like there can't be any common exceptions to that. :D

You have your points and I agree with them in the cases you mentioned but in the case of using a terminal emulator with tabs on a desktop/laptop computer screen (e.g. your eyes usually glance at the upper-left to middle parts of a screen/window) having the terminal prompt start at the very bottom of the screen is jarring and I'd rather not get used to it as I don't have a problem with locating where my prompt is to begin with. Because:

That's why I asked "Why do you prefer ...?" so thanks for answering; I got to understand your view a little better.

ccelik97 commented 1 year ago

so I have to make the defaults suboptimal and then allow those who care to undo the damage.

By the way, what other defaults in Zsh4Humans do you consider as suboptimal?

romkatv commented 1 year ago

If you prefer, imagine that I preface all my statements with "In my opinion". So, "in my opinion, prompt at bottom is objectively better". I truly believe that it is.

your eyes usually glance at the upper-left to middle parts of a screen/window

That's a habit formed by using shells with prompt at the top. Habits can change. I used to look for prompt in my terminal at the top, too, but now I look for it at the bottom.

By the way, what other defaults in Zsh4Humans do you consider as suboptimal?

They are all described in tips.

ccelik97 commented 1 year ago

"in my opinion ... is objectively better"

Nope, that's not how objectivity works. :D

If something is a personal view on a matter and not a consensus (e.g. backed by statistics, on which I haven't seen any such studies so far) then by definition it isn't objective. And as by definition there can't be a mention of a consensus in a sample size of 1 (is anecdotal) it's statistically insignificant: It just doesn't make sense to refer to subjective views as objectivity without any further studies to be done on a sample size of 2 at the very least (but a sample size of just 2 is often considered as insignificant as just 1 if the population size is considerably larger than "several" so, the closer your sample size to the size of the entire population, the better).

Anyway, my intention was to understand your view better, not to really argue with it as at least the defaults I didn't always prefer to have are easy to change so thanks again for answering (and providing these options).

romkatv commented 1 year ago

Objective isn't the same thing as consensus. Leaving that aside, my statement works for any definition of "objective" that you like.

Whenever I make a statement "X", you can substitute it for any of the following. Choose what best suits you.

I wouldn't be claiming X if I didn't believe it. On the other hand, anything I claim comes from me, so it's my opinion.

I'm not trying to argue semantics here. I'm trying to explain how my communication should be interpreted in order to extract the intended meaning from it.

romkatv commented 1 year ago

my intention was to understand your view better, not to really argue

I would prefer the opposite. I don't find the discussion of personal quirks particularly valuable. On the other hand, I would be happy if you provided arguments opposing the claim that prompt at bottom is better. I presented mine expecting that you would either be convinced or argue against my proposition.

romkatv commented 1 year ago

I've tried to clean up my position. Is it more convincing?

Q: Why is prompt at bottom better? A: Because it allows for the the most important information in the terminal to always be at the same position.

Q: Why don't shells implement prompt at bottom? A: Because it cannot be done on top of TTY.

Q: Why don't all zsh4humans users use prompt at bottom? A: They either don't realize that it's better or don't want to incur switching costs.

Q: Doesn't it mean that prompt at bottom is worse for some users? A: I'm staying on iPhone 13 because I don't want to incur switching costs. It does not mean that iPhone 13 is better than 14.

Q: Why is prompt at bottom not the default in zsh4humans. A: The cost of switching to zsh4humans is already high. If all unorthodox features were enabled by default, new users would be overwhelmed.

ccelik97 commented 1 year ago

Objective isn't the same thing as consensus.

You're correct, they aren't the same things. I'd in fact give you the benefit of the doubt here as even if you were to tell me that "n>2 number of people have responded and the consensus is as I told you so" I'd have taken it as objective enough in this case.

I'm trying to explain how my communication should be interpreted in order to extract the intended meaning from it.

Yeah, that's why I wanted to learn more about your point of view.

I don't find the discussion of personal quirks particularly valuable.

It is valuable when you're the developer behind a popular project within a collaborating community lol, that's the point.

if you provided arguments opposing the claim that prompt at bottom is better.

I already did, in fact 2 times so far here and here but to repeat myself: I find it easier when my prompt & cursor starts at the top, closer to the window/tab titles in comparison to it starting at the bottom; on a desktop/laptop computer (as in the presence of a keyboard that's separate to the computer screen). But if it was on a more intimate, hands-on medium like typing on a smartphone screen using a touch keyboard that takes up space at the bottom part of a vertical screen then it'd make more sense to me to have my prompt closer to my touch based, on-screen keyboard (similarly to the next-word suggestions & messagebox positioning).

I've tried to clean up my position. Is it more convincing? ...

Yeah, you went to great lengths to explain your point and again, thank you for that. It's important to clarify what you mean especially in the case of being the person behind such a popular project. Now me and possibly others too will be able to understand what you mean more clearly when you say such things.

ccelik97 commented 1 year ago

Btw I have another question (not necessarily a feature request):

As you managed to change the position of the prompt to the bottom by using tmux, would it also be possible to display the prompt at the center of the tmux view, floating over the rest of the view? For a result kinda similarly to ScreenKey or Show Me The Key I mean.

So the outputs/logs of the previously ran commands would be displayed on the entire underlying tmux view with the prompt displaying in the middle/on the center with a semi transparent or even blurred background (does tmux support blur in views?) etc.

romkatv commented 1 year ago

No, that isn't possible.

Semnodime commented 5 months ago

@ccelik97 Although stetching the purpose of initial purpose of this communication channel, I have to state that all data (including statistical evidence) is subject to subjectivity.

"in my opinion ... is objectively better"

Nope, that's not how objectivity works. :D It is, for the same reason I share @romkatv's view of objectivity: you can object, ...thereby potentially changing my (or somebody else's) subjective experience of truth, which itself is (in my opinion) just a nice concept benefitting us physically self-sustaining / self-reproducing creatures, just like causality.

Semnodime commented 5 months ago

I propose the follow-up question should be

which AFAICT is a mix of interwoven adaptions of us biological creatures to our physical environment:

I don't yet have formed an opinion on why English is serialized left to right and more importantly top to bottom. I presume, it's for the same reason, though I'd be happy to be corrected. I guess, evolution benefits a graphical layout with an concise and abstract title (thus on top) and a more in-depth elaboration beneath, in case you "want to dig deeper".

Maybe the devil literally is in the details, which reside below, aka in hell.

romkatv commented 5 months ago

I prefer UI elements, such as prompt or window title, to be in fixed places. If I could make prompt always stay at the top, I might prefer that to its being at the bottom. I don't know how to achieve that.

Semnodime commented 5 months ago

Having the prompt stay at the top is easy (at least conceptionally, that is). Creating an environment in which this is useful is hard (or impossible), as you have reasoned in https://github.com/romkatv/zsh4humans/issues/246#issuecomment-1339167434 and https://github.com/romkatv/powerlevel10k-media/issues/2#issuecomment-725415740.

I don't know if the western norm of serializing text from top to bottom is arbitrary and the concept just hardened in culture over time or if evolution is attracted to it, as in it being more mimetically stable than the other way around.

I might consider playing with almostontop, which trades displaying part of history for "reserving" some view space for the upcoming command output, to experience what habit can be re-learned and what is too baked-in in physiology / biology. Note that it does not fix the prompt though, as an "always on top"-implementation would.

Give me some time to think about it, to share my conclusions with you :)