Score:0

How to separate commands issued in a terminal from their output?

tr flag

I'm realising that for 90% of my day I'm staring at the same part of my screen -- the bottom-left corner -- while I type commands and wait for output. I'm starting to develop quite the neck strain, constantly staring downward like that and it got me thinking: surely there's a way for my terminal to separate the line on which I'm writing commands from the output that they generate, and therefore place the input line consistently at the top of the screen?

Something like this:

+---------------------------------------------+
| $                                                                           |
+---------------------------------------------+
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
+---------------------------------------------+

+---------------------------------------------+
| $ uname -om                                                                 |
+---------------------------------------------+
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
+---------------------------------------------+

+---------------------------------------------+
| $ echo "Hello World"                                                        |
+---------------------------------------------+
| $ uname -om                                                                 |
| x86_64 GNU/Linux                                                            |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
+---------------------------------------------+

+---------------------------------------------+
| $                                                                           |
+---------------------------------------------+
| $ uname -om                                                                 |
| x86_64 GNU/Linux                                                            |
| $ echo "Hello World"                                                        |
| "Hello World"                                                               |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
+---------------------------------------------+

Is this something that can be done with a creative Bash prompt, or maybe with tmux or something else like a GTK terminal emulator I've not heard of yet?

user10489 avatar
nc flag
You should probably just raise your screen height. I have a thick book under mine.
Daniel Quinn avatar
tr flag
I thought about that, and it's obviously the easiest solution, but then I'm just moving the problem as I'd be constantly looking way-up to read the output.
user10489 avatar
nc flag
Sounds like your monitor is too large for comfort or you are too close. Or your main window is too large. Good posture is important in computer work.
Daniel Quinn avatar
tr flag
Well when you're working at home, you've got options, but for laptop work you're rather restricted. Positioning the cursor at the bottom of the screen where your hands are necessitates that looking-down. Are you saying that what I'm looking for doesn't exist?
user10489 avatar
nc flag
Maybe an external monitor would help then? I haven't seen anything like what you suggest, but it could be written. Might even be able to do it by setting the bottom part of the window as a scrolling region and have the prompt move between that and a non-scrolling region at the top.
in flag
One way or the other, product recommendations are off topic. There is [softwarerecs.se] and [hardwarerecs.se].
Daniel Quinn avatar
tr flag
It doesn't need to be a software recommendation. If there's a way to write a zsh theme or even pointers for how to write something like this would be appreciated.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.