Skip to content

Question: Place element on last line of terminal #896

Description

@Feuermurmel

Is there a way to place output on the last line of the terminal, when the complete output of the application is shorter than the terminal height (e.g. just a few lines)?

My use case

I'm trying to create an application that uses an interface similar to GNU Readline-based applications

example.sh:
read -p "enter value: " value
echo "value: ${value}"
$ bash example.sh
enter value: hello
value: hello

IMHO, an important aspect of Readline's UI is that it will use the last line of the terminal, when there's enough input already before it:

Image

I think this is important because users that regularly use Readline-based applications (like Bash or most other shells) will probably expect a prompt to be displayed on the last line of their terminal, while an output line that is followed by an empty line means the application is currently busy and not waiting for input. Example:

Image

Another use-case would be to print something related to the input below the input line, e.g. what zsh does when the user uses the tab key to show completions:

Image

Activity

  1. changed the title [-]Question:[/-] [+]Question: Place element on last line of terminal[/+] on Mar 8, 2026
  2. Repository owner locked and limited conversation to collaborators on Mar 8, 2026
  3. converted this issue into a discussion #897 on Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions