directvt / vtm

Text-based desktop environment
MIT License
1.63k stars 43 forks source link

[feature request] configurable window border #584

Closed Fan-iX closed 7 months ago

Fan-iX commented 7 months ago

For application windows without a border, it is difficult to distinguish the text inside a window from the text in other windows below it, and in wt, shift + double-click selection will recognize any consecutive letters as one word.

I use the terminal selection instead of vtm selection because I have vim mouse support enabled. Enabling vtm selection will block mouse input for the application.

Can we have a configurable solid border for app windows? I noticed that there is a /config/appearance/defaults/bordersz option in /src/vtm.xml, but I didn't see any difference after I change its value in settings.xml.

o-sdn-o commented 7 months ago

The /config/appearance/defaults/bordersz option is currently not used by anything, and it can be adapted for this purpose. This will be the size in cells of the side borders of the window.

There is also an option ESC [ 30 : <n> p to set horizontal scrolling indents, but this does not solve the copying issue. Perhaps these options can be combined to make things more consistent. I will think about how to implement this wisely.

o-sdn-o commented 7 months ago

Additionally, I think a one-shot toggle on the vtm terminal side would be useful for selecting and copying text when mouse tracking is active.

Fan-iX commented 7 months ago

Additionally, I think a one-time toggle on the vtm terminal side would be useful for selecting and copying text when mouse tracking is active.

Indeed.

Speaking of which, I noticed that for a shell window, switching TerminalWrapMode/TerminalSelectionMode/TerminalCwdSync will moves the focus to the input line. When selection mode is disabled, I have to re-scroll back to find the text I'v found in the scrollback buffer after clicking the TerminalSelectionMode toggle.

o-sdn-o commented 7 months ago

switching TerminalWrapMode/TerminalSelectionMode/TerminalCwdSync will moves the focus to the input line

I will fix this inappropriate behavior. The scroll position should not be reset when pressing menu buttons related to text selection.

o-sdn-o commented 7 months ago

I have added a side border option config/term/layout/border (=0 by default):

<config>
    <term>
        <layout>
            <oversize=0 opacity=0xC0/>  <!-- Scrollback horizontal (left and right) oversize. (for convenient horizontal scrolling). -->
            <border=1/>                 <!-- Viewport's left and right border. -->
        </layout>
    </term>
</config>

image

Fan-iX commented 7 months ago

This works fine for me, but the window title seems to be missing when config/menu/wide is on in the v0.9.79 release. image

o-sdn-o commented 7 months ago

Oops, I changed the calculation of the basis for nested objects and it went wrong. I will fix it. Thanks for the feedback!

o-sdn-o commented 7 months ago

I fixed the wide taskbar layout.