directvt/vtm

Settings error

Closed this issue · 12 comments

So this has been happening recently:

collin@collin-RX16:~/vtm_linux_x86_64$ vtm
 tty: Pseudoterminal /dev/pts/1 and how do I fix it?
  os: Terminal type: xterm-256color
  os: Color mode: xterm truecolor
  os: Mouse mode: VT-style
 vtm: v2025.07.28
args: vtm
apps: Update settings source files from 
      /etc/vtm/settings.xml
      ~/.config/vtm/settings.xml
apps: Loading settings from "/etc/vtm/settings.xml"...
      Not found
apps: Loading settings from "/home/collin/.config/vtm/settings.xml"...
 xml: Unexpected closing tag name 'item', expected: 'taskbar' at "/home/collin/.config/vtm/settings.xml":8
 xml: Inconsistent xml data from "/home/collin/.config/vtm/settings.xml":
 1: <config>
 2:   <desktop>
 3:     <taskbar>
 4:       <item splitter label='Favorites'/>
 5:       <item label='Carbonyl' title=label type='term' cmd='carbonyl'/>
 6:             <item label='btop' title=label type='term' cmd='btop'/>
 7:             <item label='mc' title=label type='term' cmd='mc'/>
 8:         <config/terminal/menu/item*/>
 9:       </item> Unexpected closing tag name 'item', expected: 'taskbar'
10:     </taskbar>
11:   </desktop>
12: </config>
13: 


      Loaded 368 bytes
      Merging settings from "/home/collin/.config/vtm/settings.xml"
collin@collin-RX16:~/vtm_linux_x86_64$ 

What does this mean and how do I fix it?

What does this mean

The previous <item> element was previously closed in one line:
Image

The configuration format is based on the XML 1.1 standard. You can see the details here: https://en.wikipedia.org/wiki/XML#Key_terminology.

The list of differences from the XML 1.1 standard can be found here: https://github.com/directvt/vtm/blob/master/doc/settings.md#differences-from-classical-xml.

Working configuration:

<config>
  <desktop>
    <taskbar>
      <item splitter label='Favorites'/>
      <item label='Carbonyl' title=label type='term' cmd='carbonyl'>
        <config/terminal/menu/item*/>
      </item>
      <item label='btop' title=label type='term' cmd='btop'>
        <config/terminal/menu/item*/>
      </item>
      <item label='mc' title=label type='term' cmd='mc'>
        <config/terminal/menu/item*/>
      </item>
    </taskbar>
  </desktop>
</config>

or you can use templates:

<config>
  <desktop>
    <taskbar>
      <item splitter label='Favorites'/>
      <no_def_menu>
        <config/terminal/menu/item*/>
        <type='term'/>
      </no_def_menu>
      <item=no_def_menu label='Carbonyl' title=label cmd='carbonyl'/>
      <item=no_def_menu label='btop' title=label cmd='btop'/>
      <item=no_def_menu label='mc' title=label cmd='mc'/>
    </taskbar>
  </desktop>
</config>

or

<config>
  <desktop>
    <taskbar>
      <item splitter label='Favorites'/>
      <no_def_menu title=label type='term'>
        <config/terminal/menu/item*/>
      </no_def_menu>
      <item=no_def_menu label='Carbonyl' cmd='carbonyl'/>
      <item=no_def_menu label='btop' cmd='btop'/>
      <item=no_def_menu label='mc' cmd='mc'/>
    </taskbar>
  </desktop>
</config>

What is the difference between all the configurations you gave?

These configurations are essentially the same. All of these configurations produce the same result. They differ only in the way the parameters of the elements are declared.

The second and third configurations use templates. This is not in standard XML, so I gave them to you separately. Templates allow you to reduce the boilerplate code.

<no_def_menu> is a template that can be applied to all <item>s using assignment <item=no_def_menu ... to avoid repeating the same attributes.

      <no_def_menu title=label type='term'>
        <config/terminal/menu/item*/>
      </no_def_menu>

Hello! Something weird happened when I copy-pasted the 3rd config. All the options, like the "Exclusive", "<" and ">" window title bar buttons disappeared (incuding all the other buttons). But the Terminal Emulator window title bar options still exist. Is this intentional?

All the options, like the "Exclusive", "<" and ">" window title bar buttons disappeared (incuding all the other buttons).
Is this intentional?

Yes.

In the following configuration the Carbonyl and btop have window menu buttons, but mc doesn't:

<config>
  <desktop>
    <taskbar>
      <item splitter label='Favorites'/>
      <item label='Carbonyl' title=label type='term' cmd='carbonyl'/>
      <item label='btop' title=label type='term' cmd='btop'/>
      <item label='mc' title=label type='term' cmd='mc'>
        <config/terminal/menu/item*/> <!-- Remove all window menu buttons. -->
      </item>
    </taskbar>
  </desktop>
</config>

But the Terminal Emulator window title bar options still exist.

I don't understand what you mean.

Perhaps you meant the presence of the built-in terminal 'Terminal Emulator' window menu buttons, which is configured by its own menu item.

Don't confuse the following configuration subsections which have the same name <config>:

The first <config> is a global subsection:

<config> <!-- The first: Global `<config>`. -->
  ...
</config>

The second <config> is a subsection of <config/desktop/taskbar/item> element:

<config> <!-- The first: Global `<config>`. -->
  <desktop>            <!-- Vtm desktop configuration. --> 
    <taskbar>          <!-- Desktop taskbar configuration. --> 
      <item>           <!-- Taskbar menu item definition. If using the inline syntax it would be: <item label='mc' title=label type='term' cmd='mc'> -->
        <label='mc'/>  <!-- Taskbar item label. -->
        <title=label/> <!-- Application window title. It refers to the value of the '<label=' (because it is without quotes). -->
        <type='term'/> <!-- Application host type is 'term' (aka built-in terminal). -->
        <cmd='mc'/>    <!-- Command to run application inside the host. -->
        <config>       <!-- The seconds `<config>`. --> <!-- If using the compact syntax it would be: <config/terminal/menu/item*/> -->
          <terminal>   <!-- Terminal settings for 'mc'. -->
            <menu>     <!-- Window menu settings for 'mc'. -->
              <item*>  <!-- An asterisk at the end of the name 'item' means that all previously defined window menu items (buttons) will be removed for 'mc'. -->
              </item>
            </menu>
          </terminal>
        </config>
      </item>
    </taskbar>
  </desktop>
</config>

The second <config> is passed to the running application ('mc' in this case) and becomes the global config for it (and only for it).

When I said buttons, this is what I mean:

Image My original config (the one with the error) had those buttons when I clicked the things such as "mc".

(I switched to the broken config but only temporary)

Image This is what I mean by buttons. (The ones in the window title bar) Did you remove something?

If you want to leave all the buttons of the window menu, then here is the configuration:

<config>
  <desktop>
    <taskbar>
      <item splitter label='Favorites'/>
      <item label='Carbonyl' title=label type='term' cmd='carbonyl'/>
      <item label='btop' title=label type='term' cmd='btop'/>
      <item label='mc' title=label type='term' cmd='mc'/>
    </taskbar>
  </desktop>
</config>

Hello! It is fixed now, thank you.