Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

customizable statusbar #687

Closed
christianparpart opened this issue May 7, 2022 · 7 comments · Fixed by #1459
Closed

customizable statusbar #687

christianparpart opened this issue May 7, 2022 · 7 comments · Fixed by #1459
Labels
enhancement New feature or request feature-request User requested features VT: Backend Virtual Terminal Backend (libterminal API)

Comments

@christianparpart
Copy link
Member

christianparpart commented May 7, 2022

Configuration

profiles:
    PROFILE_NAME:
        status_line:
            display: indicator # one of: none, indicator,

            # Indicator status line specific configuration.
            indicator:
                # Update interval only applies to internal process execution, e.g. for `${Shell:...}`
                update_interval: 15 # seconds
                left: "#{InputMode} #{Date:%Y-%m-%s %H:%M:%S}"
                middle: "${Title}"                 # default: empty
                right: "#{shell:uptime}"           # default: shows the current time

Format specifiers

Format Description
{InputMode} current input mode, e.g. NORMAL or INSERT, ...
{Shell:COMMMAND} shows the output of the given command being executed using the login shell
{Date:Format} date (and/or time) in the given format, e.g. {Date:%H:%M:%S}
{fg:NAME} defines the foreground color for the next text
{fg:#RRGGBB} defines the foreground color in hex notation for the next text
{bg:NAME} defines the background color for the next text
{bg:#RRGGBB} defines the background color in hex notation for the next text
{Reset} resets color/styles to their defaults
{Bold} enables bold font
{Italic} enables italic font
{Underline:STYLE} enables the given underline style, e.g. normal, curly, ...
{Title} current window title
{DECModes:Pm} Shows current state for VT modes of interest, a comma separated list of mode numbers
{ANSIModes:Pm} like DECModes, but for ANSI mode numbers
{Cell:UTF8} Shows the hovered cell content as an escaped UTF-8 sequence
{Cell:UTF32} Shows the hovered cell content in UTF-32 codepoint sequence
{Cell:SGR} Shows the hovered cell's SGR attribute numbers
{Session:IdleTime} Timespan since last input activity
{Session:Uptime} Uptime since session start

For {fg:NAME} and {bg:NAME} the name are color names like red, green etc or their numbers as found in the color palette (a value between 0 and 264 (inclusive) for indexed color palette access).

@christianparpart christianparpart added enhancement New feature or request VT: Backend Virtual Terminal Backend (libterminal API) feature-request User requested features labels May 7, 2022
@j4james
Copy link

j4james commented May 8, 2022

FYI, there's a whole section on the workings of the status line in the DEC STD-070 manual, assuming you have a copy of that. It's in chapter 14 - labelled as 14-001 in the PDF table of contents, or starting around page 1036 of the PDF.

@christianparpart
Copy link
Member Author

@j4james do you have any plans in adding something like this (implementing the two VT seqs above) for WT maybe too? I am currently PoC-implementing this, and I actually see not just some potential example for shells (host writable status line) but also a user-configurable per TE config, similar to what tmux can do. The indicator status-line could also be of great use for power users (or TE devs?) showing the actual UTF-8 sequence of the grid cell under the current mouse cursor and other states.

@j4james
Copy link

j4james commented Jun 4, 2022

Ultimately I'd like to implement most of the DEC VT sequences, and I believe the status display extension is a requirement for level 3, so it's definitely on my TODO list. It's not a priority at the moment, though, so it'll probably be a while before I get to it.

@christianparpart
Copy link
Member Author

contour-indicator-status-line

@j4james luckily the DEC STD 070 (chapter 14, thx btw) is explicitly only giving recommendations of what an indicator line should display. There's not really anything mandatory. The above screenshot shows how it looks like for Contour for now. Especially the format of the status line isn't formalized. So the implementor has quite some freedom (which I personally find good).

What wonders me is the fact that they say the status line (host writable or Indicator) is at least one line. I didn't find how that one could be made configurable. I wonder if there is some benefit in supporting status line count greater than 1.

@j4james
Copy link

j4james commented Jun 6, 2022

That's looking good. I'm not sure about the multi-line status thing though. I vaguely recall some of the DEC terminals having an additional line for keyboard status below the main status line, so that's possibly what they were referring to. I don't think that line was writeable though.

Btw, if you want to look at how other terminals emulators have implemented this, there are quite a few that I know of:

  • Reflection Desktop
  • PowerTerm
  • TTWin
  • VTStar
  • RLogin
  • KoalaTerm
  • TeraTerm
  • MLTerm

The last four don't support the "Indicator status" option, though - they only allow the "Host-writable" option or nothing.

I also know that both Kermit and IBM Personal Communications have some kind of "indicator status" line by default, and in theory it should be host-writable too, but I couldn't get either of them to work. It's possibly just a config option somewhere, but I didn't spend much time trying to figure it out.

@christianparpart
Copy link
Member Author

@j4james Reviving an oldish ticket here. I don't see why the indicator statusline should be host writable, because that's what the host writable statusline is there for. However, I'm planning to finally make the indicator statusline actually customizable, finally, because we want to give it a little bit more prominence in our TE, as I see some value in having one. :)

I am actually considering supporting displaying both, indicator as well as host writable at the same time (host writable's content could be embedded into the middle of the indicator one, e.g., or both lines at full with stacked vertically).

I feel it is really hard to check indicator statusline support that against other TEs because it's hard to find some, despite the list above that you provided to me thanksfully. But they all seem to be corporate.

However, I think it would be "okayish" to deviate from the standard (as far as indicator statusline is concerned), because I don't think that this is some software that'll be connected with a power plant or so (just saying) that would fire up when the statusline would not look like specced by DEC :)

p.s.: You said you have that on your TODO list. Any updates on that? And did you refer to WT in that context? If not, which TE then?

@j4james
Copy link

j4james commented Feb 4, 2024

However, I'm planning to finally make the indicator statusline actually customizable

That sounds like a nice idea.

I am actually considering supporting displaying both, indicator as well as host writable at the same time (host writable's content could be embedded into the middle of the indicator one, e.g., or both lines at full with stacked vertically).

Stacked is possibly OK, but I'm not sure embedding would work. Any app that is using the host writeable status line is going to expect that they have the full width of the screen to work with. Things are likely to break if the content is getting clipped earlier than it should be.

I feel it is really hard to check indicator statusline support that against other TEs because it's hard to find some, despite the list above that you provided to me thanksfully. But they all seem to be corporate.

Those that aren't free should have a trial version you can download and try out for a couple of weeks. That should be plenty of time, if you just want to test their status line functionality.

You said you have that on your TODO list. Any updates on that?

I was actually thinking about this recently. I've just been adding paging support to Windows Terminal, and I thought that architecture might turn out to be a good base on which to build the status line. The problem is I don't see how I can get it to work over conpty, so it may only be usable in conhost. And if that's the case, I'd probably keep it in my private fork, because I don't think the MS devs are keen on conhost-only features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature-request User requested features VT: Backend Virtual Terminal Backend (libterminal API)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants