Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

using bottom line for status bar

Aug
124
0
Hi,

I'd like to implement a simple kind of status bar in the bottom line of the console window (using pre_input and scrput). Is there a way to tell TCC not to display the prompt on the last line? (because it overwrites the status bar)
 
Hi,

I'd like to implement a simple kind of status bar in the bottom line of the console window (using pre_input and scrput). Is there a way to tell TCC not to display the prompt on the last line? (because it overwrites the status bar)
I don't think there's a built-it way (I hope I'm wrong). I simply don't like the prompt on the last line. I did it in my 4CONSOLE plugin a while back but removed it because I didn't want to force it on all users of 4CONSOLE.

I think this is what I did, in a plugin keystroke handler
Code:
if ( csbi.dwCursorPosition.Y == csbi.srWindow.Bottom || (csbi.dwCursorPosition.Y == csbi.srWindow.Bottom-1 && csbi.dwCursorPosition.X == csbi.dwSize.X-1 ))
   SendMessage(g.hWndConsole, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), NULL);

But I must wonder ... What happens if the status bar is on the last line, the prompt is on the next-to-last line, and you type a command longer than one line? Without some intervention I'd expect the command to overwrite the status line.
 
Hi Thorsten,

it would be easier IMHO to display your status info at the top of the console and nail the input line to or near the bottom. In 4DOS times there were very elaborate ANSI prompt sequences to do just that.

The advantage is that you will find your input line always at the same position, you can use CLS to paint the whole console the color you like, you'll see the input and output of preceding commands, you won't overwrite your status line (though it may scroll off for very long inputs).
 
You convinced me: I switched from bottom to top. The "status bar" (not real one as it is only updated when executing a command) is finished now (at least for the moment). The code is not exactly pretty but maintainable. Attached the tmux original and my attempt to recreate that in TCC.

The "styling" of the status bar items (CapacityUnitPercentage%) is taken from Byobu (which is a kind of pre-configured Tmux). Thanks to everyone who helped!!

tcc status bar.png
Zsh in tmux status bar.png
 

Attachments

  • Zsh in tmux status bar.png
    Zsh in tmux status bar.png
    69.5 KB · Views: 281

Similar threads

Back
Top