summaryrefslogtreecommitdiff
path: root/op-mode-definitions/terminal.xml
blob: 9c4e629cb4178c91873917eb0d7873411e440ad0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?xml version="1.0"?>
<interfaceDefinition>
  <node name="clear">
    <properties>
      <help>Clear system information</help>
    </properties>
    <children>
      <node name="console">
        <properties>
          <help>Clear screen</help>
        </properties>
        <command>/usr/bin/clear</command>
      </node>
    </children>
  </node>
  <node name="reset">
    <properties>
      <help>Reset a service</help>
    </properties>
    <children>
      <node name="terminal">
        <properties>
          <help>Reset terminal</help>
        </properties>
        <command>/usr/bin/reset</command>
      </node>
    </children>
  </node>
  <node name="set">
    <properties>
      <help>Set operational options</help>
    </properties>
    <children>
      <tagNode name="builtin">
        <properties>
          <help>Bash builtin set command</help>
          <completionHelp>
            <list>&lt;OPTION&gt;</list>
          </completionHelp>
        </properties>
        <command>builtin $3</command>
      </tagNode>

      <node name="console">
        <properties>
          <help>Control console behaviors</help>
        </properties>
        <children>
          <leafNode name="keymap">
            <properties>
              <help>Reconfigure console keyboard layout</help>
            </properties>
            <command>sudo dpkg-reconfigure -f dialog keyboard-configuration &amp;&amp; sudo systemctl restart keyboard-setup</command>
          </leafNode>
        </children>
      </node>

      <node name="terminal">
        <properties>
          <help>Control terminal behaviors</help>
        </properties>
        <children>

          <node name="key">
            <properties>
              <help>Set key behaviors</help>
            </properties>
            <children>
              <tagNode name="query-help">
                <properties>
                  <help>Enable/disable getting help using question mark (default enabled)</help>
                  <completionHelp>
                    <list>enable disable</list>
                  </completionHelp>
                </properties>
                <command>${vyos_op_scripts_dir}/toggle_help_binding.sh $5</command>
              </tagNode>
            </children>
          </node>

          <node name="pager">
            <properties>
              <help>Set terminal pager to default (less)</help>
            </properties>
            <command>VYATTA_PAGER=${_vyatta_default_pager}</command>
          </node>
          <tagNode name="pager">
            <properties>
              <help>Set terminal pager</help>
              <completionHelp>
                <list>&lt;PROGRAM&gt;</list>
              </completionHelp>
            </properties>
            <command>VYATTA_PAGER=$4</command>
          </tagNode>

          <tagNode name="length">
            <properties>
              <help>Set terminal to given number of rows (0 disables paging)</help>
              <completionHelp>
                <list>&lt;NUMBER&gt;</list>
              </completionHelp>
            </properties>
            <command>if [ "$4" -eq 0 ]; then VYATTA_PAGER=cat; else VYATTA_PAGER=${_vyatta_default_pager}; stty rows $4; fi</command>
          </tagNode>

          <tagNode name="width">
            <properties>
              <help>Set terminal to given number of columns</help>
              <completionHelp>
                <list>&lt;NUMBER&gt;</list>
              </completionHelp>
            </properties>
            <command>stty columns $4</command>
          </tagNode>
        </children>
      </node>
    </children>
  </node>


</interfaceDefinition>