Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I understand what you're thinking. You want a kind of separate command input box at top, with scrolling output underneath.
Well, it's possible to use ansi escape codes or tput in your PS1 or PROMPT_COMMAND to reposition the cursor at the top of the screen after each command. However, the output scrolling is a separate function, so you'd just end up positioning it inside whatever text was just printed in your last command. It wouldn't act like a "floating" box or anything.
I don't know if it's possible to directly control the scrolling behavior, either, especially not to "reverse" it. There'd be a lot of possible situations to consider, like how to treat commands that give out formatted data, or continuous streams, as well as how to deal with multi-line command input. I imagine you'd have to completely redesign the console from scratch to be sure to create the kind of split behavior you want.
I doubt it's possible because the shell simply prints the prompt after the last command's output.
I guess the only good solution would be to make a terminal with a line entry on top where you enter the command and it pastes the command into the actual terminal window below when you hit enter.
@MTK358: Unless I dreamt it I think I saw someone somewhere on the internet who did have that kind of behaviour in his virtual consoles (the kind you're describing). I beleive he used some sort of script, like a wrapper that read input and gave output.
He could do lots of cool stuff with it, although it was still gnome-terminal/bash under the hood.
I'll post a link if I find it (or have another vivid dream about it).
I beleive he used some sort of script, like a wrapper that read input and gave output.
Intriguing.
A function rather than a script would execute in the same shell and so have access to its settings. The $PROMPT_COMMAND variable can be used to run a command (= alias, built-in command, external command or function) after each command returns. The $BASH_COMMAND variable holds the last command executed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.