Pushdown Terminal Output
Clash Royale CLAN TAG#URR8PPP
up vote
14
down vote
favorite
Is there a standard way to reverse the output order of a terminal output, ie:
~/Developer $ command0
-bash: comman0: command not found
~/Developer $ command2
-bash: command2: command not found
~/Developer $ command3
-bash: command3: command not found
~/Developer $
would be displayed as:
~/Developer $
-bash: command3: command not found
~/Developer $ command3
-bash: command2: command not found
~/Developer $ command2
-bash: comman0: command not found
~/Developer $ comman0
I feel always having your prompt at the bottom is counter intuitive a more effective way of presenting the output woud be to reverse the output order. How might I go about implementing this? Specifically where output portion of the OSX terminal program defined?
terminal
 |Â
show 1 more comment
up vote
14
down vote
favorite
Is there a standard way to reverse the output order of a terminal output, ie:
~/Developer $ command0
-bash: comman0: command not found
~/Developer $ command2
-bash: command2: command not found
~/Developer $ command3
-bash: command3: command not found
~/Developer $
would be displayed as:
~/Developer $
-bash: command3: command not found
~/Developer $ command3
-bash: command2: command not found
~/Developer $ command2
-bash: comman0: command not found
~/Developer $ comman0
I feel always having your prompt at the bottom is counter intuitive a more effective way of presenting the output woud be to reverse the output order. How might I go about implementing this? Specifically where output portion of the OSX terminal program defined?
terminal
This would confuse me, but I applaud your efforts. On of linux/unix/open source major lesssons is that One Size Does Not Fit All.
â Bruce Ediger
Apr 3 '12 at 17:18
I think this is not possible at all unless you change the source code of the shell (e.g.bash
).
â Renan
Apr 3 '12 at 17:20
4
You'd need to hack more than just the shell. Terminals have been scrolling this way since they were electromechanical. At the very least, I'd say you'd need to hack a terminal emulator, maybe also a shell.
â Alexios
Apr 3 '12 at 17:31
This is actually counter intuitive. Have you noticed the ENTER key arrow? It points to the line below, not above.
â dresende
Apr 3 '12 at 18:07
Is there a way to grab the items of out put from a terminal, my thought is to create some sort of wrapper which grabs each of these output items, treats each of them similar to how tweets are posted with the newest always apear on top and sticking the input prompt at the top of the Wrapper UI.
â rudolph9
Apr 3 '12 at 21:13
 |Â
show 1 more comment
up vote
14
down vote
favorite
up vote
14
down vote
favorite
Is there a standard way to reverse the output order of a terminal output, ie:
~/Developer $ command0
-bash: comman0: command not found
~/Developer $ command2
-bash: command2: command not found
~/Developer $ command3
-bash: command3: command not found
~/Developer $
would be displayed as:
~/Developer $
-bash: command3: command not found
~/Developer $ command3
-bash: command2: command not found
~/Developer $ command2
-bash: comman0: command not found
~/Developer $ comman0
I feel always having your prompt at the bottom is counter intuitive a more effective way of presenting the output woud be to reverse the output order. How might I go about implementing this? Specifically where output portion of the OSX terminal program defined?
terminal
Is there a standard way to reverse the output order of a terminal output, ie:
~/Developer $ command0
-bash: comman0: command not found
~/Developer $ command2
-bash: command2: command not found
~/Developer $ command3
-bash: command3: command not found
~/Developer $
would be displayed as:
~/Developer $
-bash: command3: command not found
~/Developer $ command3
-bash: command2: command not found
~/Developer $ command2
-bash: comman0: command not found
~/Developer $ comman0
I feel always having your prompt at the bottom is counter intuitive a more effective way of presenting the output woud be to reverse the output order. How might I go about implementing this? Specifically where output portion of the OSX terminal program defined?
terminal
terminal
asked Apr 3 '12 at 17:16
rudolph9
6351123
6351123
This would confuse me, but I applaud your efforts. On of linux/unix/open source major lesssons is that One Size Does Not Fit All.
â Bruce Ediger
Apr 3 '12 at 17:18
I think this is not possible at all unless you change the source code of the shell (e.g.bash
).
â Renan
Apr 3 '12 at 17:20
4
You'd need to hack more than just the shell. Terminals have been scrolling this way since they were electromechanical. At the very least, I'd say you'd need to hack a terminal emulator, maybe also a shell.
â Alexios
Apr 3 '12 at 17:31
This is actually counter intuitive. Have you noticed the ENTER key arrow? It points to the line below, not above.
â dresende
Apr 3 '12 at 18:07
Is there a way to grab the items of out put from a terminal, my thought is to create some sort of wrapper which grabs each of these output items, treats each of them similar to how tweets are posted with the newest always apear on top and sticking the input prompt at the top of the Wrapper UI.
â rudolph9
Apr 3 '12 at 21:13
 |Â
show 1 more comment
This would confuse me, but I applaud your efforts. On of linux/unix/open source major lesssons is that One Size Does Not Fit All.
â Bruce Ediger
Apr 3 '12 at 17:18
I think this is not possible at all unless you change the source code of the shell (e.g.bash
).
â Renan
Apr 3 '12 at 17:20
4
You'd need to hack more than just the shell. Terminals have been scrolling this way since they were electromechanical. At the very least, I'd say you'd need to hack a terminal emulator, maybe also a shell.
â Alexios
Apr 3 '12 at 17:31
This is actually counter intuitive. Have you noticed the ENTER key arrow? It points to the line below, not above.
â dresende
Apr 3 '12 at 18:07
Is there a way to grab the items of out put from a terminal, my thought is to create some sort of wrapper which grabs each of these output items, treats each of them similar to how tweets are posted with the newest always apear on top and sticking the input prompt at the top of the Wrapper UI.
â rudolph9
Apr 3 '12 at 21:13
This would confuse me, but I applaud your efforts. On of linux/unix/open source major lesssons is that One Size Does Not Fit All.
â Bruce Ediger
Apr 3 '12 at 17:18
This would confuse me, but I applaud your efforts. On of linux/unix/open source major lesssons is that One Size Does Not Fit All.
â Bruce Ediger
Apr 3 '12 at 17:18
I think this is not possible at all unless you change the source code of the shell (e.g.
bash
).â Renan
Apr 3 '12 at 17:20
I think this is not possible at all unless you change the source code of the shell (e.g.
bash
).â Renan
Apr 3 '12 at 17:20
4
4
You'd need to hack more than just the shell. Terminals have been scrolling this way since they were electromechanical. At the very least, I'd say you'd need to hack a terminal emulator, maybe also a shell.
â Alexios
Apr 3 '12 at 17:31
You'd need to hack more than just the shell. Terminals have been scrolling this way since they were electromechanical. At the very least, I'd say you'd need to hack a terminal emulator, maybe also a shell.
â Alexios
Apr 3 '12 at 17:31
This is actually counter intuitive. Have you noticed the ENTER key arrow? It points to the line below, not above.
â dresende
Apr 3 '12 at 18:07
This is actually counter intuitive. Have you noticed the ENTER key arrow? It points to the line below, not above.
â dresende
Apr 3 '12 at 18:07
Is there a way to grab the items of out put from a terminal, my thought is to create some sort of wrapper which grabs each of these output items, treats each of them similar to how tweets are posted with the newest always apear on top and sticking the input prompt at the top of the Wrapper UI.
â rudolph9
Apr 3 '12 at 21:13
Is there a way to grab the items of out put from a terminal, my thought is to create some sort of wrapper which grabs each of these output items, treats each of them similar to how tweets are posted with the newest always apear on top and sticking the input prompt at the top of the Wrapper UI.
â rudolph9
Apr 3 '12 at 21:13
 |Â
show 1 more comment
3 Answers
3
active
oldest
votes
up vote
5
down vote
In bash this will display the current prompt/command at the top, and its output below, but with no scrolling or previous commands:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1'
This function will put previous commands below, but you have to pipe each and every command to it individually. Unfortunately, exec > >(f)
can't help with this as it redirects the whole of bash, not individual commands. Here's the function:
f () xargs expr 1 +
Then run every command like:
command args |f
It saves the output, creates a number of blank lines equal to length+1, then puts the output back in. You can tag a line on at the end that will display a fake prompt or horizontal rule if you like. E.g.
printf '%*s' $COLUMNS | tr ' ' _;
As a crap but automatic alternative to this whole function thing, we can add a command to the end of our earlier $PROMPT_COMMAND that clears a somewhat arbitrary 11 lines:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1; tput il 11'
You can also use tput -S
to avoid multiple binary calls.
I got the $PROMPT_COMMAND
from https://github.com/swirepe/alwaysontop .
add a comment |Â
up vote
5
down vote
Unfortunately, this will be fairly difficult. The protocol between the applications and the OS-X terminal is a variant of the VT100 / ANSI terminal control protocol, specifically the XTerm protocol.
That includes a bunch of assumptions about screen position, etc, that would be challenging to remap to a world where the display was reversed.
Even worse, all your terminal emulator gets is a string of "put this character at this position" type commands. There is no distinction made between the command prompt and the output of a command run by it, so you can't do one thing for both parts - at least, not without cooperation from the shell underneath.
The shell, and the programs, assume that the screen proceeds upwards - new data at the bottom, and carries on downward forever.
You could, at least theoretically, have your terminal emulator modified so that it displayed lines in reverse order - the "bottom" line first, and so on up to the "top" line at the bottom of the screen.
That would reverse the order of lines in command output, though, so the rest of the content would pop out backwards too. If you wanted the commands (eg: ls, cat) to run "down" but prompts to move "up" life is harder.
I don't know any software that implements this. (...but see JdeBD's comment to this for a link to one.) :)
I do. (-:
â JdeBP
Aug 27 at 19:54
add a comment |Â
up vote
4
down vote
Although this won't exactly reverse output, it will keep your prompt at the top:
https://github.com/swirepe/alwaysontop
To use it run:
git clone https://github.com/swirepe/alwaysontop.git
cd alwaysontop/
source alwaysontop.sh
If you decide you like it just source it in your .bash_profile with something like:
echo "source ~/alwaysontop/alwaysontop.sh" >> ~/.bash_profile
Hope that helps!
This is a bit buggy (e.g. with tab-autocomplete and history) but it's a very good demo of what this UI might feel like if it was implemented properly. I think it's valuable for that - to help people know if they'd want it or not!
â scipilot
Apr 27 '17 at 4:34
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
In bash this will display the current prompt/command at the top, and its output below, but with no scrolling or previous commands:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1'
This function will put previous commands below, but you have to pipe each and every command to it individually. Unfortunately, exec > >(f)
can't help with this as it redirects the whole of bash, not individual commands. Here's the function:
f () xargs expr 1 +
Then run every command like:
command args |f
It saves the output, creates a number of blank lines equal to length+1, then puts the output back in. You can tag a line on at the end that will display a fake prompt or horizontal rule if you like. E.g.
printf '%*s' $COLUMNS | tr ' ' _;
As a crap but automatic alternative to this whole function thing, we can add a command to the end of our earlier $PROMPT_COMMAND that clears a somewhat arbitrary 11 lines:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1; tput il 11'
You can also use tput -S
to avoid multiple binary calls.
I got the $PROMPT_COMMAND
from https://github.com/swirepe/alwaysontop .
add a comment |Â
up vote
5
down vote
In bash this will display the current prompt/command at the top, and its output below, but with no scrolling or previous commands:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1'
This function will put previous commands below, but you have to pipe each and every command to it individually. Unfortunately, exec > >(f)
can't help with this as it redirects the whole of bash, not individual commands. Here's the function:
f () xargs expr 1 +
Then run every command like:
command args |f
It saves the output, creates a number of blank lines equal to length+1, then puts the output back in. You can tag a line on at the end that will display a fake prompt or horizontal rule if you like. E.g.
printf '%*s' $COLUMNS | tr ' ' _;
As a crap but automatic alternative to this whole function thing, we can add a command to the end of our earlier $PROMPT_COMMAND that clears a somewhat arbitrary 11 lines:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1; tput il 11'
You can also use tput -S
to avoid multiple binary calls.
I got the $PROMPT_COMMAND
from https://github.com/swirepe/alwaysontop .
add a comment |Â
up vote
5
down vote
up vote
5
down vote
In bash this will display the current prompt/command at the top, and its output below, but with no scrolling or previous commands:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1'
This function will put previous commands below, but you have to pipe each and every command to it individually. Unfortunately, exec > >(f)
can't help with this as it redirects the whole of bash, not individual commands. Here's the function:
f () xargs expr 1 +
Then run every command like:
command args |f
It saves the output, creates a number of blank lines equal to length+1, then puts the output back in. You can tag a line on at the end that will display a fake prompt or horizontal rule if you like. E.g.
printf '%*s' $COLUMNS | tr ' ' _;
As a crap but automatic alternative to this whole function thing, we can add a command to the end of our earlier $PROMPT_COMMAND that clears a somewhat arbitrary 11 lines:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1; tput il 11'
You can also use tput -S
to avoid multiple binary calls.
I got the $PROMPT_COMMAND
from https://github.com/swirepe/alwaysontop .
In bash this will display the current prompt/command at the top, and its output below, but with no scrolling or previous commands:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1'
This function will put previous commands below, but you have to pipe each and every command to it individually. Unfortunately, exec > >(f)
can't help with this as it redirects the whole of bash, not individual commands. Here's the function:
f () xargs expr 1 +
Then run every command like:
command args |f
It saves the output, creates a number of blank lines equal to length+1, then puts the output back in. You can tag a line on at the end that will display a fake prompt or horizontal rule if you like. E.g.
printf '%*s' $COLUMNS | tr ' ' _;
As a crap but automatic alternative to this whole function thing, we can add a command to the end of our earlier $PROMPT_COMMAND that clears a somewhat arbitrary 11 lines:
PROMPT_COMMAND='tput cup 0 0; tput el; tput el1; tput il 11'
You can also use tput -S
to avoid multiple binary calls.
I got the $PROMPT_COMMAND
from https://github.com/swirepe/alwaysontop .
edited Oct 14 '13 at 5:15
answered Oct 14 '13 at 4:44
Tommy Jollyboat
5112
5112
add a comment |Â
add a comment |Â
up vote
5
down vote
Unfortunately, this will be fairly difficult. The protocol between the applications and the OS-X terminal is a variant of the VT100 / ANSI terminal control protocol, specifically the XTerm protocol.
That includes a bunch of assumptions about screen position, etc, that would be challenging to remap to a world where the display was reversed.
Even worse, all your terminal emulator gets is a string of "put this character at this position" type commands. There is no distinction made between the command prompt and the output of a command run by it, so you can't do one thing for both parts - at least, not without cooperation from the shell underneath.
The shell, and the programs, assume that the screen proceeds upwards - new data at the bottom, and carries on downward forever.
You could, at least theoretically, have your terminal emulator modified so that it displayed lines in reverse order - the "bottom" line first, and so on up to the "top" line at the bottom of the screen.
That would reverse the order of lines in command output, though, so the rest of the content would pop out backwards too. If you wanted the commands (eg: ls, cat) to run "down" but prompts to move "up" life is harder.
I don't know any software that implements this. (...but see JdeBD's comment to this for a link to one.) :)
I do. (-:
â JdeBP
Aug 27 at 19:54
add a comment |Â
up vote
5
down vote
Unfortunately, this will be fairly difficult. The protocol between the applications and the OS-X terminal is a variant of the VT100 / ANSI terminal control protocol, specifically the XTerm protocol.
That includes a bunch of assumptions about screen position, etc, that would be challenging to remap to a world where the display was reversed.
Even worse, all your terminal emulator gets is a string of "put this character at this position" type commands. There is no distinction made between the command prompt and the output of a command run by it, so you can't do one thing for both parts - at least, not without cooperation from the shell underneath.
The shell, and the programs, assume that the screen proceeds upwards - new data at the bottom, and carries on downward forever.
You could, at least theoretically, have your terminal emulator modified so that it displayed lines in reverse order - the "bottom" line first, and so on up to the "top" line at the bottom of the screen.
That would reverse the order of lines in command output, though, so the rest of the content would pop out backwards too. If you wanted the commands (eg: ls, cat) to run "down" but prompts to move "up" life is harder.
I don't know any software that implements this. (...but see JdeBD's comment to this for a link to one.) :)
I do. (-:
â JdeBP
Aug 27 at 19:54
add a comment |Â
up vote
5
down vote
up vote
5
down vote
Unfortunately, this will be fairly difficult. The protocol between the applications and the OS-X terminal is a variant of the VT100 / ANSI terminal control protocol, specifically the XTerm protocol.
That includes a bunch of assumptions about screen position, etc, that would be challenging to remap to a world where the display was reversed.
Even worse, all your terminal emulator gets is a string of "put this character at this position" type commands. There is no distinction made between the command prompt and the output of a command run by it, so you can't do one thing for both parts - at least, not without cooperation from the shell underneath.
The shell, and the programs, assume that the screen proceeds upwards - new data at the bottom, and carries on downward forever.
You could, at least theoretically, have your terminal emulator modified so that it displayed lines in reverse order - the "bottom" line first, and so on up to the "top" line at the bottom of the screen.
That would reverse the order of lines in command output, though, so the rest of the content would pop out backwards too. If you wanted the commands (eg: ls, cat) to run "down" but prompts to move "up" life is harder.
I don't know any software that implements this. (...but see JdeBD's comment to this for a link to one.) :)
Unfortunately, this will be fairly difficult. The protocol between the applications and the OS-X terminal is a variant of the VT100 / ANSI terminal control protocol, specifically the XTerm protocol.
That includes a bunch of assumptions about screen position, etc, that would be challenging to remap to a world where the display was reversed.
Even worse, all your terminal emulator gets is a string of "put this character at this position" type commands. There is no distinction made between the command prompt and the output of a command run by it, so you can't do one thing for both parts - at least, not without cooperation from the shell underneath.
The shell, and the programs, assume that the screen proceeds upwards - new data at the bottom, and carries on downward forever.
You could, at least theoretically, have your terminal emulator modified so that it displayed lines in reverse order - the "bottom" line first, and so on up to the "top" line at the bottom of the screen.
That would reverse the order of lines in command output, though, so the rest of the content would pop out backwards too. If you wanted the commands (eg: ls, cat) to run "down" but prompts to move "up" life is harder.
I don't know any software that implements this. (...but see JdeBD's comment to this for a link to one.) :)
edited Aug 31 at 17:12
answered Apr 3 '12 at 17:28
Daniel Pittman
5,17012116
5,17012116
I do. (-:
â JdeBP
Aug 27 at 19:54
add a comment |Â
I do. (-:
â JdeBP
Aug 27 at 19:54
I do. (-:
â JdeBP
Aug 27 at 19:54
I do. (-:
â JdeBP
Aug 27 at 19:54
add a comment |Â
up vote
4
down vote
Although this won't exactly reverse output, it will keep your prompt at the top:
https://github.com/swirepe/alwaysontop
To use it run:
git clone https://github.com/swirepe/alwaysontop.git
cd alwaysontop/
source alwaysontop.sh
If you decide you like it just source it in your .bash_profile with something like:
echo "source ~/alwaysontop/alwaysontop.sh" >> ~/.bash_profile
Hope that helps!
This is a bit buggy (e.g. with tab-autocomplete and history) but it's a very good demo of what this UI might feel like if it was implemented properly. I think it's valuable for that - to help people know if they'd want it or not!
â scipilot
Apr 27 '17 at 4:34
add a comment |Â
up vote
4
down vote
Although this won't exactly reverse output, it will keep your prompt at the top:
https://github.com/swirepe/alwaysontop
To use it run:
git clone https://github.com/swirepe/alwaysontop.git
cd alwaysontop/
source alwaysontop.sh
If you decide you like it just source it in your .bash_profile with something like:
echo "source ~/alwaysontop/alwaysontop.sh" >> ~/.bash_profile
Hope that helps!
This is a bit buggy (e.g. with tab-autocomplete and history) but it's a very good demo of what this UI might feel like if it was implemented properly. I think it's valuable for that - to help people know if they'd want it or not!
â scipilot
Apr 27 '17 at 4:34
add a comment |Â
up vote
4
down vote
up vote
4
down vote
Although this won't exactly reverse output, it will keep your prompt at the top:
https://github.com/swirepe/alwaysontop
To use it run:
git clone https://github.com/swirepe/alwaysontop.git
cd alwaysontop/
source alwaysontop.sh
If you decide you like it just source it in your .bash_profile with something like:
echo "source ~/alwaysontop/alwaysontop.sh" >> ~/.bash_profile
Hope that helps!
Although this won't exactly reverse output, it will keep your prompt at the top:
https://github.com/swirepe/alwaysontop
To use it run:
git clone https://github.com/swirepe/alwaysontop.git
cd alwaysontop/
source alwaysontop.sh
If you decide you like it just source it in your .bash_profile with something like:
echo "source ~/alwaysontop/alwaysontop.sh" >> ~/.bash_profile
Hope that helps!
answered Oct 10 '14 at 23:05
ryanpcmcquen
1515
1515
This is a bit buggy (e.g. with tab-autocomplete and history) but it's a very good demo of what this UI might feel like if it was implemented properly. I think it's valuable for that - to help people know if they'd want it or not!
â scipilot
Apr 27 '17 at 4:34
add a comment |Â
This is a bit buggy (e.g. with tab-autocomplete and history) but it's a very good demo of what this UI might feel like if it was implemented properly. I think it's valuable for that - to help people know if they'd want it or not!
â scipilot
Apr 27 '17 at 4:34
This is a bit buggy (e.g. with tab-autocomplete and history) but it's a very good demo of what this UI might feel like if it was implemented properly. I think it's valuable for that - to help people know if they'd want it or not!
â scipilot
Apr 27 '17 at 4:34
This is a bit buggy (e.g. with tab-autocomplete and history) but it's a very good demo of what this UI might feel like if it was implemented properly. I think it's valuable for that - to help people know if they'd want it or not!
â scipilot
Apr 27 '17 at 4:34
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f35627%2fpushdown-terminal-output%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
This would confuse me, but I applaud your efforts. On of linux/unix/open source major lesssons is that One Size Does Not Fit All.
â Bruce Ediger
Apr 3 '12 at 17:18
I think this is not possible at all unless you change the source code of the shell (e.g.
bash
).â Renan
Apr 3 '12 at 17:20
4
You'd need to hack more than just the shell. Terminals have been scrolling this way since they were electromechanical. At the very least, I'd say you'd need to hack a terminal emulator, maybe also a shell.
â Alexios
Apr 3 '12 at 17:31
This is actually counter intuitive. Have you noticed the ENTER key arrow? It points to the line below, not above.
â dresende
Apr 3 '12 at 18:07
Is there a way to grab the items of out put from a terminal, my thought is to create some sort of wrapper which grabs each of these output items, treats each of them similar to how tweets are posted with the newest always apear on top and sticking the input prompt at the top of the Wrapper UI.
â rudolph9
Apr 3 '12 at 21:13