r/PowerShell • • Jun 27 '26

Question Console layout reverse, is it possible?

I want to place the command prompt always on top, and below it in descending order, the executed commands. Is it possible? Something like:

> | # active prompt

--- # something like a separator line

> # Result to Get-Something-Else
> Get-Something-Else # executed command
> # Result to Get-Something
> Get-Something  # older executed command
> # and so on, older commands are below
10 Upvotes

7 comments sorted by

5

u/420GB Jun 27 '26

This would best be implemented at the terminal, you can ask for it as a feature on the Windows terminal repository

1

u/carloswm85 Jun 28 '26

I will take a look to their repository issues. Do you know of any other teminal/emulator that implements something like what I'm looking for?

2

u/dodexahedron Jun 27 '26 edited Jun 27 '26

This is a function of the terminal. Since youre most likely running it in an xterm compatible terminal (microsoft terminal is one), the terminal buffer itself is already against you, and the alternate buffer will be even worse.

If you really want this, you will need to design your own terminal emulator, or at least your own command line shell.

If all you want is a running log of the commands themselves, you can just write thr transcript to somemething being displayed in another pane. But for output, you've got work to do.

The world decided on bottom-up 50+ years ago. Don't fight it, for your own sake.

1

u/carloswm85 Jun 28 '26

You're probably just right in your last statement. I don't have time for reinventing the wheel.

1

u/MonkeyNin Jun 29 '26

Do you know with shell integration, you can make a hotkey jump directly to your prompts? So instead of pageup 14 times and then 4 times,

you just hit pageup 2 times to jump to 2 prompts

VSCode does it automatically. Windows terminal has: https://learn.microsoft.com/en-us/windows/terminal/tutorials/shell-integration

It should work on any modern terminal

0

u/StartAutomating Jun 27 '26 edited Jun 27 '26

Yes and No.

It would be technically possible to do this in a normal PowerShell host, simply by using an escape sequence to set the cursor to 0, 0 in your prompt function.

This would always make your prompt appear at the top of the screen.

However, you'd be fighting the terminal quite a bit.

Stuff like progress bars would overwrite your prompt. Each next output will appear atop the previous output (but wouldn't clear it).

When coupled with a clear screen, this would basically work once per command.

So, that's the bad news.

The good news is that this is actually pretty trivial to do in a browser. If you just set up a loopback server on a random port, you can expose this sort of thing as a web app.

A few months back I made a "mostly safe" server called Reptile. I originally made it as a way to host Turtle in a safe environment, and the example shell for Turtle does this atop of PowerShell data blocks. It could use some improvement, but it proves the concept in a web browser decently enough.