-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Prompt at the bottom of the terminal window? #563
Comments
put this line in your zshrc, before load instant prompt. printf '\n%.0s' {1..100} |
Yes, that's pretty much how I've recorded this. You can even see cursor in the top-left corner on the first frame of the gif. I found that for users who aren't familiar with transient prompt it's much easier to follow what's going on when prompt is at the bottom. After you use transient prompt for a little while, it becomes natural regardless of prompt position. |
To bump a closed issue; I think this would be a good configuration option. When I saw the gif for transient prompts I expected (and was hoping) it would push the input to the bottom. |
It's easy to push cursor to the bottom of the screen when you start zsh. The problem is that it can be pushed up by zle, zle widgets and external commands. When this happens, there is no way to push it back down without filling (a portion of) screen with empty space. This feature could be implemented in a terminal but not on the level of applications running in the terminal. |
When using # Change cursor to I-beam
printf '\033[5 q\r'
# Move prompt to the bottom
printf '\n%.0s' {1..100} the prompt appears at shell startup like so:
but after using a command, it shifts to the bottommost line like so:
Would it be possible to fix this inconsistency (i.e. have the prompt either always have an empty line under it or always show on the bottommost line - ideally the former)? |
This is impossible without patching the source code of your terminal emulator.
You can do this by adding the following parameter to typeset -g POWERLEVEL9K_INSTANT_PROMPT_COMMAND_LINES=0 It doesn't matter where exactly in Once you add the parameter, restart zsh (e.g., with |
Rather than choosing an arbitrarily high number of blank lines to print, you can use the actual height of the terminal which is (usually) set in the environment variable printf '\n%.0s' {1..$LINES} Note that this should be placed in your |
But it goes up when we use |
If you are using zsh4humans, see https://github.com/romkatv/zsh4humans/blob/master/tips.md#prompt-at-bottom If not, improvise. |
No, I am not using zsh4humans. I am using the typewriter theme. |
Then improvise. |
|
This avoids printing a bunch of newlines and also does the 'clear' |
You could also use something like:
And to make sure the prompt stays down after using something like fzf, I have this in my zsh hooks:
The |
For my case, I don't want the prompt to be permanently at the bottom, I just want to make it so that when terminal starts filling down, the prompt never fully touches the bottom and stays a certain distance from the bottom to be within reasonably readable range. Before using Powerlevel10k, I configured my zsh prompt to use this solution: https://unix.stackexchange.com/questions/698587/keep-cursor-prompt-vertically-centered-in-zsh-fish/698626#698626 When I tried to adapt this to Powerlevel10k, I found that adding user-defined prompt segment didn't work. The way I adapted this was to make change to precmd() {
# This makes the prompt stays at least 8 lines from the bottom
print $'\n\n\n\n\n\n\n\n\e[8A'
} Which will works exactly as expected. The only downsides are that: (1) because this will output during zsh initialization, you might want to set in your |
I noticed in a number of your screen recordings where transient prompt is enabled you've got the prompt at the bottom of the terminal window.
e.g. https://raw.githubusercontent.com/romkatv/powerlevel10k-media/master/performance.gif
Is this just a visual trick with the recording, or do you really have a way to have GNOME terminal start with the prompt at the bottom of the window? If the latter, would you mind sharing?
Thanks for building such a useful and enjoyable tool.
The text was updated successfully, but these errors were encountered: