5 ms·
Does anybody know a shell that keeps its input line on top of the window? Think of a browser window with the url-bar being the shell line editor. But of course
by softwarelimits 10y ago
Does anybody know a shell that keeps its input line on top of the window?
Think of a browser window with the url-bar being the shell line editor. But of course I want a real, quick shell, not a clunky electron-based monster or some html based shell simulation in a browser.
I imagine that it will have a positive effect on our neck muscles if we would not have to stare at the bottom of the screen all the time, but instead at the top.
I looked into the existing pythonic shell libraries like the python-prompt-toolkit but could not figure out in a few minutes how this could be realized, so I hope some experts in this field would like to spend a few minutes on this?
Thanks for your attention!
- calgoo 10y agoI think that it has to do with the flow of the text in the console. the historic text flows upwards, so it is natural to expect input on the next newline. You can of course use a termbox/termkit type library and move the input to the top row, but it would overwrite older historic text, unless you reverse the flow of the history as well.
- to3m 10y agoYou just need two text areas: one at the top where you enter text, and one at the bottom where the scrolling happens. This is not rocket science, but I'm sure it's actually literally impossible in Unix, which in general has never moved on from the idea that a computer's primary output device is a printer printing on an endless roll of paper.
- lallysingh 10y agoSure you can, just use (n)curses.
- to3m 10y agoDoes that work with the scrollback? If it's supposed to, I've yet to see it ever happen!
- dTal 10y agoHave a look at bpython.
- to3m 10y agoI'll try it when I get a moment, but I'll take your word for it for now. From the screenshots it looks to me very much like it'll be a single scrolling viewport, though, with a line of input at the end. So, at heart, differing in some of the details, but no more than a few, a printer printing on a long roll of paper...
- dTal 10y agoWell, yes, it doesn't attempt to modify the semantics of the terminal - the opposite, in fact. I brought it up as an example of something that uses curses for all kinds of fancy stuff, but integrates with the terminal's normal scrollback. Sorry for any misunderstanding.
- coldtea 10y ago>So, at heart, differing in some of the details, but no more than a few, a printer printing on a long roll of paper... The responses of commands are "long rolls of digital paper". They could be from 1 to millions of lines long. So what exactly would your solution do differently? And it's not "unix" that does it this way, it's VMS, Windows, and pretty much everybody. In fact your concept is still not concrete enough to make sense. The browser can have a single address bar on top, because urls are a single string -- and they also don't interact with subsequent contents, commands, etc.
- marcosdumay 10y agoHum... Say you have an interactive command that takes a "y" keystroke. Does your history becomes like this: Second result - line 1 Second result - line 2 Command prompt y First result - line 1 First result - line 2 Or this: First result - line 1 First result - line 2 Command prompt y Second result - line 1 Second result - line 2 And if it is the second option, how does it at the instants it shows the prompt, and after it gets a result? Looks complex to me.
- eru 10y agoIn eg bash you can set the title of your X window to arbitrary things. See http://stackoverflow.com/questions/1687642/set-screen-title-from-shellscript http://stackoverflow.com/questions/1687642/set-screen-title-... You could reset the title on each keystroke, or even just after inputting the full command.
- coldtea 10y agoHe means having the input prompt be on top, not the last command he wrote...
- xiaq 10y agohttps://github.com/swirepe/alwaysontop https://github.com/swirepe/alwaysontop is this what you need? ascii.io seems down, but there is another screencast hosted here: https://asciinema.org/a/3779 https://asciinema.org/a/3779
- lanna 10y agoIt seems to clear the screen at each new command, resetting scroll history every time. Renders it pretty much useless for most of us.
- coldtea 10y agoWhat part of unautoclear Turn OFF clear-screen after each command. seems difficult?
- softwarelimits 10y agoThis looks great, I will try! Thanks to all of you for your efforts!
- Pete_D 10y agoThis sounded like fun, so I had a go at implementing it for bash using ANSI control codes[0][1] (though other people have posted much better solutions). You still have to look at the bottom to see the command's output though, so I'm not sure you gain much. If you're having neck troubles, is adjusting your monitor an option? [0] http://pastebin.com/xaLFyXtT http://pastebin.com/xaLFyXtT - implementation [1] http://www.termsys.demon.co.uk/vtansi.htm http://www.termsys.demon.co.uk/vtansi.htm - reference for some ANSI control codes
- gnuarch 10y agoMaybe possible with two terminal windows? One to enter commands only, another for displaying any output -- chained together via named pipes.