diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 3eb98ea49b..0c9300eeb6 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -26,35 +26,41 @@ jobs:
cpu: universal
arch: any
cxx: c++
+ cc: cc
flags: '-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG -Wall -Wextra -Wno-missing-field-initializers -Werror"'
- os: windows-latest
platform: windows
cpu: Win32
arch: x86
cxx: cl
- flags: '-DCMAKE_EXE_LINKER_FLAGS_RELEASE="/DEBUG /OPT:REF /OPT:ICF" -DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /DNDEBUG /Zi /Zc:preprocessor /W4" -A '
+ cc: cl
+ flags: '-DCMAKE_EXE_LINKER_FLAGS_RELEASE="/DEBUG /OPT:REF /OPT:ICF" -DCMAKE_C_FLAGS_RELEASE="/MT /O2 /c" -DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /DNDEBUG /Zi /Zc:preprocessor /W4" -A '
- os: windows-latest
cxx: cl
- os: ubuntu-latest
cpu: x64
cxx: g++
+ cc: gcc
- os: ubuntu-latest
cpu: x86
- apt: g++-i686-linux-gnu
+ apt: g++-i686-linux-gnu gcc-i686-linux-gnu
cxx: /bin/i686-linux-gnu-g++
+ cc: /bin/i686-linux-gnu-gcc
- os: ubuntu-latest
cpu: arm
- apt: g++-arm-linux-gnueabihf
+ apt: g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
cxx: /bin/arm-linux-gnueabihf-g++
+ cc: /bin/arm-linux-gnueabihf-gcc
- os: ubuntu-latest
cpu: arm64
- apt: g++-aarch64-linux-gnu
+ apt: g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
cxx: /bin/aarch64-linux-gnu-g++
+ cc: /bin/aarch64-linux-gnu-gcc
- os: ubuntu-latest
- flags: '-DCMAKE_CXX_FLAGS_RELEASE="-static -s -O2 -DNDEBUG -Wall -Wextra -Wno-missing-field-initializers -Wno-psabi -Werror"'
+ flags: '-DCMAKE_C_FLAGS="-O2 -static" -DCMAKE_CXX_FLAGS_RELEASE="-static -s -O2 -DNDEBUG -Wall -Wextra -Wno-missing-field-initializers -Wno-psabi -Werror"'
- os: windows-latest
- flags: '-DCMAKE_EXE_LINKER_FLAGS_RELEASE="/DEBUG /OPT:REF /OPT:ICF" -DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /DNDEBUG /Zi /Zc:preprocessor /W4" -A '
+ flags: '-DCMAKE_EXE_LINKER_FLAGS_RELEASE="/DEBUG /OPT:REF /OPT:ICF" -DCMAKE_C_FLAGS_RELEASE="/MT /O2 /c" -DCMAKE_CXX_FLAGS_RELEASE="/MT /O2 /DNDEBUG /Zi /Zc:preprocessor /W4" -A '
- os: ubuntu-latest
platform: linux
@@ -88,6 +94,7 @@ jobs:
run: >
cmake -B ${{ steps.strings.outputs.bin }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
+ -DCMAKE_C_COMPILER=${{ matrix.cc }}
${{ matrix.flags }} ${{ matrix.os == 'windows-latest' && matrix.cpu || '' }}
-DCMAKE_BUILD_TYPE=Release
-S ${{ github.workspace }}
@@ -95,10 +102,6 @@ jobs:
- name: Build
run: cmake --build ${{ steps.strings.outputs.bin }} --config Release
- - name: Test (POSIX)
- if: matrix.os != 'windows-latest' && matrix.cpu != 'arm' && matrix.cpu != 'arm64'
- run: ${{ steps.strings.outputs.bin }}/vtm -v
-
- name: Pack (POSIX)
if: matrix.os != 'windows-latest'
run: 7z a -ttar vtm_${{ matrix.platform }}_${{ matrix.arch }}.tar ${{ steps.strings.outputs.bin }}/vtm
diff --git a/.gitignore b/.gitignore
index 2e773465a9..604518012d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/.vs
/.vscode
/bin
+/build
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 62926d7f66..4053a38800 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,37 +1,55 @@
-cmake_minimum_required (VERSION 3.10)
+cmake_minimum_required(VERSION 3.24)
-project ("vtm")
-# project ("term")
-# project ("calc")
+project("vtm")
+# project("term")
+# project("calc")
-set (CMAKE_CXX_STANDARD 20)
-set (CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Set the build type to Release if none is specified.
-if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
- set (CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
-endif ()
+if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
+ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
+endif()
-if (CMAKE_SYSTEM_NAME STREQUAL "Windows") # WIN32 and similar checks are soft-deprecated
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows") # WIN32 and similar checks are soft-deprecated
# Disable manifest embedding for the windows builds.
# Reason: Anti-virus program (Windows Defender) may lock and scan `vtm.exe` file before embedding the manifest.
# mt.exe: general error c101008d: Failed to write the updated manifest to the resource of file...
- #set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
+ #set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
# /EHsc Tells the compiler that exceptions can only occur at a throw statement or at a function call.
# /bigobj Our event model spawns a large number of objects. By default, an object file can hold up to 65,279 (almost 2^16) addressable sections. This limit applies no matter which target platform is specified. /bigobj increases that address capacity to 4,294,967,296 (2^32).
# /utf-8 All literals in our source code are in UTF-8 format.
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /bigobj /utf-8 /Zc:preprocessor")
- set (WIN32_RESOURCES ".resources/images/vtm.rc")
-else ()
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /bigobj /utf-8 /Zc:preprocessor")
+ set(WIN32_RESOURCES ".resources/images/vtm.rc")
+else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLUA_USE_POSIX")
# Static linkage
- #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -pthread -s")
-endif ()
+ #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -pthread -s")
+endif()
-add_executable (vtm "src/vtm.cpp" ${WIN32_RESOURCES})
-# add_executable (term "src/netxs/apps/term.cpp")
-# add_executable (calc "src/netxs/apps/calc.cpp")
+# Lua
+include(FetchContent)
+FetchContent_Declare(lua
+ URL https://www.lua.org/ftp/lua-5.4.7.tar.gz
+ URL_HASH SHA256=9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30
+ DOWNLOAD_EXTRACT_TIMESTAMP true)
+FetchContent_MakeAvailable(lua)
+file(GLOB lua_src CONFIGURE_DEPENDS ${lua_SOURCE_DIR}/src/*.c)
+list(REMOVE_ITEM lua_src ${lua_SOURCE_DIR}/src/lua.c ${lua_SOURCE_DIR}/src/luac.c)
+add_library(lua ${lua_src})
+target_include_directories(lua PUBLIC ${lua_SOURCE_DIR}/src)
+target_sources(lua PRIVATE ${lua_src})
-if (NOT WIN32)
- install (TARGETS vtm DESTINATION bin)
-endif ()
+add_executable(vtm "src/vtm.cpp" ${WIN32_RESOURCES})
+# add_executable(term "src/netxs/apps/term.cpp")
+# add_executable(calc "src/netxs/apps/calc.cpp")
+
+target_link_libraries(vtm lua)
+# target_link_libraries(term lua)
+# target_link_libraries(calc lua)
+
+if(NOT WIN32)
+ install(TARGETS vtm DESTINATION bin)
+endif()
diff --git a/CMakeSettings.json b/CMakeSettings.json
index 473970f77a..8aedebfe65 100644
--- a/CMakeSettings.json
+++ b/CMakeSettings.json
@@ -13,7 +13,17 @@
"variables": [
{
"name": "CMAKE_CXX_FLAGS_DEBUG",
- "value": "-DDEBUG /MTd /Zi /Ob0 /Od /RTC1 /bigobj /utf-8 /Zc:preprocessor /W4",
+ "value": "/DDEBUG /MTd /Zi /Ob0 /Od /RTC1 /bigobj /utf-8 /Zc:preprocessor /W4",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS_DEBUG",
+ "value": "/DDEBUG /MTd /c",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
+ "value": "MultiThreadedDebug",
"type": "STRING"
}
],
@@ -54,7 +64,17 @@
"variables": [
{
"name": "CMAKE_CXX_FLAGS_DEBUG",
- "value": "-DDEBUG /MTd /Zi /Ob0 /Od /RTC1 /bigobj /utf-8 /Zc:preprocessor /W4",
+ "value": "/DDEBUG /MTd /Zi /Ob0 /Od /RTC1 /bigobj /utf-8 /Zc:preprocessor /W4",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS_DEBUG",
+ "value": "/DDEBUG /MTd /c",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
+ "value": "MultiThreadedDebug",
"type": "STRING"
}
]
@@ -80,6 +100,16 @@
"name": "CMAKE_CXX_COMPILER",
"value": "/bin/i686-linux-gnu-g++",
"type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_COMPILER",
+ "value": "/bin/i686-linux-gnu-gcc",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS",
+ "value": "-O2 -static",
+ "type": "STRING"
}
],
"intelliSenseMode": "linux-gcc-x86",
@@ -101,6 +131,16 @@
"name": "CMAKE_CXX_FLAGS_RELEASE",
"value": "/MT /O2 /DNDEBUG /EHsc /bigobj /utf-8 /Zc:preprocessor /W4",
"type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS_RELEASE",
+ "value": "/DNDEBUG /MT /O2 /c",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
+ "value": "MultiThreaded",
+ "type": "STRING"
}
],
"intelliSenseMode": "windows-msvc-arm"
@@ -120,6 +160,16 @@
"name": "CMAKE_CXX_FLAGS_RELEASE",
"value": "/MT /O2 /DNDEBUG /EHsc /bigobj /utf-8 /Zc:preprocessor /W4",
"type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS_RELEASE",
+ "value": "/DNDEBUG /MT /O2 /c",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
+ "value": "MultiThreaded",
+ "type": "STRING"
}
],
"intelliSenseMode": "windows-msvc-arm64"
@@ -139,6 +189,16 @@
"name": "CMAKE_CXX_FLAGS_RELEASE",
"value": "/MT /O2 /DNDEBUG /EHsc /bigobj /utf-8 /Zc:preprocessor /W4",
"type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS_RELEASE",
+ "value": "/DNDEBUG /MT /O2 /c",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
+ "value": "MultiThreaded",
+ "type": "STRING"
}
]
},
@@ -162,6 +222,16 @@
"name": "DCMAKE_EXE_LINKER_FLAGS_RELEASE",
"value": "/DEBUG /OPT:REF /OPT:ICF",
"type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS_RELEASE",
+ "value": "/DNDEBUG /MT /O2 /c",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_MSVC_RUNTIME_LIBRARY",
+ "value": "MultiThreaded",
+ "type": "STRING"
}
]
},
@@ -186,6 +256,16 @@
"name": "CMAKE_CXX_COMPILER",
"value": "/bin/arm-linux-gnueabihf-g++",
"type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_COMPILER",
+ "value": "/bin/arm-linux-gnueabihf-gcc",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS",
+ "value": "-O2 -static",
+ "type": "STRING"
}
],
"intelliSenseMode": "linux-gcc-arm",
@@ -214,6 +294,16 @@
"name": "CMAKE_CXX_COMPILER",
"value": "/bin/aarch64-linux-gnu-g++",
"type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_COMPILER",
+ "value": "/bin/aarch64-linux-gnu-gcc",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS",
+ "value": "-O2 -static",
+ "type": "STRING"
}
],
"intelliSenseMode": "linux-gcc-arm",
@@ -242,6 +332,16 @@
"name": "CMAKE_CXX_COMPILER",
"value": "/bin/i686-linux-gnu-g++",
"type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_COMPILER",
+ "value": "/bin/i686-linux-gnu-gcc",
+ "type": "STRING"
+ },
+ {
+ "name": "CMAKE_C_FLAGS",
+ "value": "-O2 -static",
+ "type": "STRING"
}
],
"intelliSenseMode": "linux-gcc-x86",
diff --git a/doc/apps.md b/doc/apps.md
index a8108a54a2..d1474489f8 100644
--- a/doc/apps.md
+++ b/doc/apps.md
@@ -24,32 +24,25 @@
- Extending selection with `Ctrl` key pressed.
- Changing selection mode (linear/box) with `Alt` key pressed.
- Selecting a word/paragraph/entire scrollback buffer or a semantic block (when using OSC 133) by Double/Triple/Quadruple/Quintuple left clicking.
-- Multiple clipboard formats support:
+- Support multiple selection copy formats:
- Plain text
- RTF
- HTML
- ANSI/VT
- - Protected (Windows only: `ExcludeClipboardContentFromMonitorProcessing`, `CanIncludeInClipboardHistory`, `CanUploadToCloudClipboard`)
-- Built-in Windows Console API server:
+ - Protected (MS Windows platform only: `ExcludeClipboardContentFromMonitorProcessing`, `CanIncludeInClipboardHistory`, `CanUploadToCloudClipboard`)
+- Built-in MS Windows Console API server:
- Legacy Win32 Console API support.
- - No Windows Console Host (conhost.exe) dependency.
+ - No MS Windows Console Host (conhost.exe) dependency.
- Fullduplex pass-through VT input/output.
- OEM/National, UTF-8 and UTF-16 encoding support.
- Enforced ENABLE_WINDOW_INPUT mode.
Note: In fact it is a viewport resize event reporting. Viewport dimensions is always equal to the win32 console buffer dimensions.
- Enforced ENABLE_PROCESSED_OUTPUT and ENABLE_VIRTUAL_TERMINAL_PROCESSING modes.
- Disabled ENABLE_QUICK_EDIT_MODE mode.
- - Per process (not per process name) Windows Command Prompt (cmd.exe) input history, aka "line input"/"cooked read".
+ - Per process (not per process name) MS Windows Command Prompt (cmd.exe) input history, aka "line input"/"cooked read".
- Stdin/stdout logging.
-### Custom SGR attributes
-
-Name | Sequence | Description
--------------------|----------------------------------|------------
-`grid color` | `CSI` 68 : 2 :: r : g : b `m`
`CSI` 68 : 5 : n `m`
`CSI` 68 : n `m` | (not implemented) Set grid color.
-`reset grid color` | `CSI` 69 `m` | (not implemented) Reset grid color (sync with foreground color).
-
-### Runtime configuraion vt-sequences
+### Private control sequences
Name | Sequence | Description
-------------|----------------------------------|------------
@@ -66,10 +59,10 @@ Name | Sequence | Description
Note: It is possible to combine multiple command into a single sequence using a semicolon. For example, the following sequence disables wrapping, enables text selection, and sets background to blue: `CSI 12 : 2 ; 29 : 1 ; 28 : 44 p` or `CSI 12 : 2 ; 29 : 1 ; 28 : 48 : 2 : 0 : 0 : 255 p`.
### Custom menu configuration
-
+
It is possible to create your own terminal window menu from scratch by specifying a list of menu items in the `` section of the configuration file.
-### Syntax
+#### Syntax
```xml
@@ -92,7 +85,7 @@ It is possible to create your own terminal window menu from scratch by specifyin
```
-### Attributes for the `` object
+#### Attributes for the `` object
Attribute | Description
-----------|------------
@@ -101,7 +94,7 @@ label | Menu item label list. One or more textual representations selected
tooltip | Tooltip content.
action | The action name which called on item activation.
-### Attributes for the `` sub-object
+#### Attributes for the `` sub-object
Attribute | Description
-----------------|------------
@@ -117,7 +110,7 @@ Value | Description
`Option` | Cyclically selects the next label in the list and calls the action with the arguments from `data=`.
`Repeat` | Selects the next label and calls the action repeatedly from the time it is pressed until it is released.
-#### Actions `action`
+#### Attribute `action` (this will soon be replaced by Lua scripting)
`*` - Not implemented.
@@ -193,7 +186,7 @@ Hotkey | Description
`Shift+Insert` | Paste from clipboard.
`Esc` | Deselect a selection if it is.
-#### Terminal configuration example
+### Configuration example
```xml
@@ -347,53 +340,40 @@ Hotkey | Description
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
```
@@ -433,7 +413,7 @@ Tiling Window Manager is a window container that organizes the workspace into mu
- `double LeftClick` -- Maxixmize/restore
- Configurable via settings (See configuration example in doc\settings.md`).
-#### Tiling Window Manager configuration example
+### Configuration example
```xml
@@ -441,7 +421,7 @@ Tiling Window Manager is a window container that organizes the workspace into mu
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
```
\ No newline at end of file
diff --git a/doc/architecture.md b/doc/architecture.md
index 4316fd3f89..6f053764bc 100644
--- a/doc/architecture.md
+++ b/doc/architecture.md
@@ -467,9 +467,9 @@ The following examples assume that vtm is installed on both the local and remote
## Standard I/O stream monitoring
-Vtm allows developers to visualize standard input/output streams of the running CUI applications. Launched in the `Desktop Monitor` mode, vtm will log the event stream of each terminal window with the `Logs` switch enabled.
+Vtm allows developers to visualize standard input/output streams of the running CUI applications. Launched in the `Log Monitor` mode, vtm will log the event stream of each terminal window with the `Logs` switch enabled.
-Important: Avoid enabling the `Logs` switch in the terminal window hosting the `Desktop Monitor` process running, this may lead to recursive event logging of event logging with unpredictable results.
+Important: Avoid enabling the `Logs` switch in the terminal window hosting the `Log Monitor` process running, this may lead to recursive event logging of event logging with unpredictable results.
## Desktop taskbar customization
@@ -504,26 +504,28 @@ The taskbar menu can be configured using a settings file `~/.config/vtm/settings
```
+#### 28 Feb 2025: This functionality is under development.
+
Additionally, the taskbar menu of the running desktop can be configured using shell piped redirection by sending script commands to the running vtm desktop:
```
# Delete existing menu items
-echo "vtm.del()" | vtm
+echo "vtm.taskbar.Del()" | vtm
```
```
# Add new menu items
-echo "vtm.set(id=Term label='Terminal' type=dtvt cmd='vtm -r term')" | vtm
-echo "vtm.set(id=White label='White Terminal' type=dtvt cmd='vtm -r term' cfg='')" | vtm
-echo "vtm.set(id=Huge label='Huge Terminal' type=dtvt cmd='vtm -r term' cfg='')" | vtm
-echo "vtm.set(id=Tile label='Three Terminals' type=tile cmd='v(h(Term, White), Huge)')" | vtm
-echo "vtm.set(id=cmd label='Remote cmd over SSH' type=dtty cmd='ssh user@server vtm cmd')" | vtm
+echo "vtm.taskbar.Set({ id='Term', label='Terminal', type='dtvt', cmd='vtm -r term' })" | vtm
+echo "vtm.taskbar.Set({ id='White', label='White Terminal', type='dtvt', cmd='vtm -r term', cfg='' })" | vtm
+echo "vtm.taskbar.Set({ id='Huge', label='Huge Terminal', type='dtvt', cmd='vtm -r term', cfg='' })" | vtm
+echo "vtm.taskbar.Set({ id='Tile', label='Three Terminals', type='tile', cmd='v(h(Term, White), Huge)' })" | vtm
+echo "vtm.taskbar.Set({ id='cmd', label='Remote cmd over SSH', type='dtty', cmd='ssh user@server vtm cmd' })" | vtm
```
```
# Set default menu item
-echo "vtm.selected(Term)" | vtm
+echo "vtm.taskbar.Selected('Term')" | vtm
```
```
# Run window with terminals
-echo "vtm.run(id=Tile)" | vtm
+echo "vtm.desktop.Run({ id='Tile' })" | vtm
```
# Desktop Live Panel
diff --git a/doc/build.md b/doc/build.md
index 62969b509d..c6a99f4002 100644
--- a/doc/build.md
+++ b/doc/build.md
@@ -2,6 +2,8 @@
## Building from source
+Note: As part of the build process, cmake downloads and compiles the Lua source code from https://www.lua.org.
+
### Unix
Build-time dependencies
diff --git a/doc/command-line-options.md b/doc/command-line-options.md
index e9780356ab..d7c26ed121 100644
--- a/doc/command-line-options.md
+++ b/doc/command-line-options.md
@@ -31,7 +31,7 @@ Option | Description
`-p`, `--pin ` | Specifies the desktop id it will be pinned to.
`-s`, `--server` | Run Desktop Server.
`-d`, `--daemon` | Run Desktop Server in background.
-`-m`, `--monitor` | Run Desktop Monitor.
+`-m`, `--monitor` | Run Log Monitor.
`-r`, `--`, `--run` | Run desktop applet standalone.
`` | Desktop applet to run.
`` | Desktop applet arguments.
@@ -62,18 +62,18 @@ The following commands have a short form:
- `vtm -r vtty ` can be shortened to `vtm `.
- `vtm -r dtty ssh ` can be shortened to `vtm ssh `.
-### Script commands
+### Scripting
-Syntax: `([])[; ([]); ... ([])]`
+#### 28 Feb 2025: This functionality is under development.
-Script Command | Description
------------------------------------------|-------------------------------------------
-`vtm.run([])` | Create and run a menu item constructed using a space-separated list of `=` (derived from existing or updated temporary item).
Create and run temporary menu item constructed using default attributes if no `` specified.
See [Settings/Taskbar menu item attributes](settings.md#Taskbar-menu-item-attributes) for details.
-`vtm.set(id= [])` | Create or override a menu item using a space-separated list of `=`.
-`vtm.del([])` | Delete the taskbar menu item by ``.
Delete all menu items if no `` specified.
-`vtm.dtvt()` | Create a temporary menu item and run the specified dtvt-executable.
-`vtm.selected()` | Set selected menu item using specified `` (affected to the desktop RightDrag gesture and Tile's `+` button).
-`vtm.shutdown()` | Terminate the running desktop session.
+Script Command | Description
+--------------------------------------------------------|-------------------------------------------
+`vtm.desktop.Run([{ }])` | Create and run a menu item constructed using a comma-separated list of `=` (derived from existing or updated temporary item).
Create and run temporary menu item constructed using default attributes if no `` specified.
See [Settings/Taskbar menu item attributes](settings.md#Taskbar-menu-item-attributes) for details.
+`vtm.taskbar.Set({ id='', [] })` | Create or override a menu item using a comma-separated list of `=`.
+`vtm.taskbar.Del([''])` | Delete the taskbar menu item by ``.
Delete all menu items if no `` specified.
+`vtm.taskbar.dtvt()` | Create a temporary menu item and run the specified dtvt-executable.
+`vtm.taskbar.Selected('')` | Set selected menu item using specified `` (affected to the desktop RightDrag gesture and Tile's `+` button).
+`vtm.desktop.Shutdown(['try'])` | Terminate the running desktop session. If `try` is specified, the server will only shut down if there are no running windows.
### Character escaping
@@ -92,6 +92,8 @@ Characters | Expanded to
### Usage Examples
+> 28 Feb 2025: Scripting functionality is under development.
+
| | Description
------------------------------------------------------|--------------------------------------------
`vtm` | Run Desktop Client.
@@ -99,9 +101,9 @@ Characters | Expanded to
`vtm -r term` | Run Terminal Console.
`vtm -r term ` | Run Terminal Console with a CUI application inside.
`vtm ssh vtm ` | Run a CUI application remotely over SSH.
-`vtm -x "vtm.del(); vtm.set(splitter id=Apps); vtm.set(id=Term)"` | Run Desktop Client and reconfigure the taskbar menu.
-`echo "vtm.del(); vtm.set(splitter id=Apps); vtm.set(id=Term)" \| vtm`
`echo "vtm.set(id=user@server type=dtty cmd='ssh vtm')" \| vtm` | Reconfigure the taskbar menu of the running desktop.
-`echo "vtm.run()" \| vtm`
`echo "vtm.run(id=Term)" \| vtm`
`echo "vtm.dtvt(vtm -r term)" \| vtm` | Run Terminal Console on the running desktop.
-`echo "vtm.run(title='Console \nApplication' cmd='')" \| vtm` | Run Teletype Console with a CUI application inside on the running desktop.
-`echo "vtm.run(type=tile title=Terminals cmd='v(h(Term,Term),Term)')" \| vtm` | Run Tiling Window Manager with three terminals attached.
-`echo "vtm.shutdown()" \| vtm` | Terminate the running desktop session.
\ No newline at end of file
+`vtm -x "vtm.taskbar.Del(); vtm.taskbar.Set({ splitter, id='Apps' }); vtm.taskbar.Set({ id='Term' })"` | Run Desktop Client and reconfigure the taskbar menu.
+`echo "vtm.taskbar.Del(); vtm.taskbar.Set({ splitter, id='Apps' }); vtm.taskbar.Set({ id='Term' })" \| vtm`
`echo "vtm.taskbar.Set({ id='user@server', type='dtty', cmd='ssh vtm' })" \| vtm` | Reconfigure the taskbar menu of the running desktop.
+`echo "vtm.desktop.Run()" \| vtm`
`echo "vtm.desktop.Run({ id='Term' })" \| vtm`
`echo "vtm.desktop.dtvt('vtm -r term')" \| vtm` | Run Terminal Console on the running desktop.
+`echo "vtm.desktop.Run({ title='Console \nApplication', cmd='' })" \| vtm` | Run Teletype Console with a CUI application inside on the running desktop.
+`echo "vtm.desktop.Run({ type='tile', title='Terminals', cmd='v(h(Term,Term),Term)' })" \| vtm` | Run Tiling Window Manager with three terminals attached.
+`echo "vtm.desktop.Shutdown()" \| vtm` | Shutdown desktop server.
\ No newline at end of file
diff --git a/doc/settings.md b/doc/settings.md
index 6d11306009..52aa508dd3 100644
--- a/doc/settings.md
+++ b/doc/settings.md
@@ -18,20 +18,22 @@ graph TB
## TL;DR
-The settings are stored in a slightly modified XML-like format which allows to store hierarchical list of key=value pairs.
+The settings are stored in an XML-like format, forming a hierarchical list of key=value pairs.
See [`/src/vtm.xml`](../src/vtm.xml) for reference.
-There are two default settings locations that can be overridden:
+We call the text data in the settings file "plain XML data" even though our file format is not technically XML, but only visually resembles it.
+
+There are two predefined settings source locations:
```xml
```
The process of loading settings consists of the following steps:
-- Build an ordered list of source files by looking for the root `` subsections.
-- Overlay the `` subsection from the source files in the loading order.
+- Build an ordered list of the setting source files by looking for the root `` subsections.
+- Overlay the `` subsection from the source files in the specified order.
- Overlay the `` subsection from the value of the `$VTM_CONFIG` environment variable or from a settings file it references.
-- Overlay the `` subsection from the DirectVT config received from the parent process.
+- Overlay the `` subsection from the DirectVT config payload received from the parent process.
- Overlay the `` subsection from the specified `--config <...>` CLI option value or from a settings file it referencing.
The file list is built in the following order from the following sources:
@@ -57,21 +59,24 @@ The file list is built in the following order from the following sources:
## Details
-### Key differences from the standard XML
+### Key differences from XML
- - All stored values are UTF-8 strings:
+ - All stored values are UTF-8 strings (the settings consumer decides on its own side how to interpret the string):
- `name=2000` and `name="2000"` have the same meaning.
- There is no distinction between XML-attribute and XML-subobject, i.e. any attributes are sub-objects:
- `` and ` ` have the same meaning.
- In addition to a set of sub-objects each object can contain its own text value:
- - E.g. ``.
+ - E.g. `` - subobject `name` has text value `names_value`.
- Each object can be defined in any way, either using an XML-attribute or an XML-subobject syntax:
- `<... name=value />`, `<...> "value" `, and `<...> ` have the same meaning.
- The object name that ending in an asterisk indicates that this object is not an object, but it is a template for all subsequent objects with the same name in the same scope. See `Template Example` below.
- Compact syntax is allowed.
- `` and `` have the same meaning.
- - Objects can reference values of other objects using absolute references (three levels of indirection allowed).
+ - Objects can reference values of other objects using absolute references (three levels of indirection allowed).
- `thing2` refers to the value `thing1` in ``.
+ - Any Unicode characters are allowed, including the U+0000 (null) character.
+ - Multiple root elements are allowed.
+ - There is no support for named XML character entities.
- Escaped characters with special meaning:
- `\a` ASCII 0x07 BEL
- `\t` ASCII 0x09 TAB
@@ -210,12 +215,12 @@ The following declarations have the same meaning:
...
-
-
+
+
...
-
+
...
-
+
...
@@ -232,32 +237,24 @@ The following declarations have the same meaning:
...
-
-
-
-
-
- ...
-
-
-
-
-
+
+
+
...
-
+
-
-
-
+
...
+
-
-
-
+
...
-
+
```
@@ -316,33 +313,32 @@ The following configuration items produce the same final result:
### Key bindings
+> 2025 Feb 28: This section is under development.
+
In vtm there are several layers of key combination processing. Each layer has its own set of key bindings. Keys processed at the previous layer usually do not get to the next one.
Layer | Config section | Description
-----------------------|------------------------------|------------
-Native GUI window | `` | Native GUI window layer key bindings.
-TUI matrix | `` | TUI matrix layer key bindings.
-Desktop environment | `` | Desktop layer key bindings (taskbar and window management).
-Application `app_name` | `` | Application layer key bindings.
+`gate` | | ...
+`desktop` | | ...
+`applet` | | ...
+`tile` | | ...
+`defapp` | | ...
+... | | ...
#### Syntax
The syntax for defining key combination bindings is:
```xml
-
-
- ...
-
-
+
```
Tag | Value
---------|--------
`key` | The text string containing the key combinations.
-`action` | The action name.
`preview`| A Boolean value specifying that hotkey actions should be processed while traversing the focus tree until the target object is reached (ignoring keyboard exclusive mode). Default is `off`.
-`data` | The arguments passed to the action.
+`script` | The Lua script body.
The following joiners are allowed for combining keys:
@@ -369,67 +365,11 @@ The required key combination sequence can be generated on the Info page, accessi
Configuration record | Interpretation
---------------------------------------------------------------|-----------------
-`` | Append existing bindings using an indirect reference (the `NameOfAction` variable without quotes).
-`` | Append existing bindings for `Key+Chord | Another+Chord`.
-`` | Append existing bindings with the directly specified command "NameOfAction".
-`` | Remove all existing bindings for the specified key combination "Key+Chord".
-`` | Append existing bindings with the directly specified command "NameOfAction" with arguments "param".
-`` | Do nothing.
-
-#### Available actions (`action=`)
-
-Action | Arguments (`data=`) | Available at layer | Description
--------------------------------|--------------------------------------------------------|---------------------|------------
-`Noop` | | All layers | Ignore all events for the specified key combination. No further processing.
-`DropAutoRepeat` | | All layers | Ignore `Key Repeat` events for the specified key combination. This binding should be specified before the main action for the key combination.
-`IncreaseCellHeight` | | Native GUI window | Increase the text cell height by one pixel.
-`DecreaseCellHeight` | | Native GUI window | Decrease the text cell height by one pixel.
-`ResetCellHeight` | | Native GUI window | Reset text cell height.
-`ToggleFullscreenMode` | | Native GUI window | Toggle fullscreen mode.
-`ToggleAntialiasingMode` | | Native GUI window | Toggle text antialiasing mode.
-`RollFontsBackward` | | Native GUI window | Roll font list backward.
-`RollFontsForward` | | Native GUI window | Roll font list forward.
-`ToggleDebugOverlay` | | TUI matrix | Toggle debug overlay.
-`FocusPrevWindow` | | Desktop | Switch focus to the next desktop window.
-`FocusNextWindow` | | Desktop | Switch focus to the previous desktop window.
-`Disconnect` | | Desktop | Disconnect from the desktop.
-`RunApplication` | _`Taskbar item id`_ | Desktop | Run application. Run the default application if no arguments are specified.
-`RunScript` | _`Script body`_ | Desktop | Run script.
-`AlwaysOnTopWindow` | `on` \| `off` | Desktop | Toggle AlwaysOnTop window flag.
-`CloseWindow` | | Desktop | Close window.
-`MinimizeWindow` | | Desktop | Minimize window.
-`MaximizeWindow` | | Desktop | Maximize window.
-`FullscreenWindow` | | Desktop | Maximize window to full screen.
-`WarpWindow` | _`IntL, IntR, IntT, IntB`_ | Desktop | Warp desktop window. The data parameter specifies four deltas for the left, right, top and bottom window sides.
-`TryToQuit` | | Desktop | Shut down the desktop server if no applications are running.
-`ExclusiveKeyboardMode` | `on` \| `off` | Application | Toggle exclusive keyboard mode.
-`TerminalFindNext` | | Application | Highlight next match of selected text fragment. Clipboard content is used if no active selection.
-`TerminalFindPrev` | | Application | Highlight previous match of selected text fragment. Clipboard content is used if no active selection.
-`TerminalScrollViewportByPage` | _`IntX, IntY`_ | Application | Scroll viewport by _`IntX, IntY`_ pages.
-`TerminalScrollViewportByCell` | _`IntX, IntY`_ | Application | Scroll viewport by _`IntX, IntY`_ cells.
-`TerminalScrollViewportToTop` | | Application | Scroll viewport to the scrollback top.
-`TerminalScrollViewportToEnd` | | Application | Scroll viewport to the scrollback bottom (reset viewport position).
-`TerminalViewportCopy` | | Application | Сopy viewport to clipboard.
-`TerminalClipboardCopy` | | Application | Сopy selection to clipboard.
-`TerminalClipboardPaste` | | Application | Paste from clipboard.
-`TerminalClipboardWipe` | | Application | Reset clipboard.
-`TerminalClipboardFormat` | `none` \| `text` \| `ansi` \|
`rich` \| `html` \| `protected` | Application | Switch terminal text selection copy format.
-`TerminalOutput` | _`Text string`_ | Application | Direct output the string to the terminal scrollback.
-`TerminalSendKey` | _`Text string`_ | Application | Simulating key presses using the specified string.
-`TerminalUndo` | | Application | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last input.
-`TerminalRedo` | | Application | (Win32 Cooked/ENABLE_LINE_INPUT mode only) Discard the last Undo command.
-`TerminalCwdSync` | | Application | Toggle the current working directory sync mode.
-`TerminalWrapMode` | `on` \| `off` | Application | Toggle terminal scrollback lines wrapping mode. Applied to the active selection if it is.
-`TerminalAlignMode` | `left` \| `right` \| `center` | Application | Set terminal scrollback lines aligning mode. Applied to the active selection if it is.
-`TerminalFullscreen` | | Application | Toggle fullscreen mode.
-`TerminalMaximize` | | Application | Toggle between maximized and normal window size.
-`TerminalMinimize` | | Application | Minimize window.
-`TerminalStdioLog` | `on` \| `off` | Application | Toggle stdin/stdout logging to the specified state, or just toggle to another state if no arguments are specified.
-`TerminalSelectionRect` | `on` \| `off` | Application | Toggle between linear and rectangular selection form.
-`TerminalSelectionCancel` | | Application | Deselect a selection.
-`TerminalSelectionOneShot` | `text` \| `ansi` \|
`rich` \| `html` \| `protected` | Application | One-shot toggle to copy text while mouse tracking is active. Keep selection if `Ctrl` key is pressed.
-`TerminalRestart` | | Application | Terminate runnning console apps and restart current session.
-`TerminalQuit` | | Application | Terminate runnning console apps and close terminal.
+`` | Append existing bindings using an indirect reference (the `ScriptReference` variable without quotes).
+`` | Append existing bindings for `Key+Chord | Another+Chord`.
+`` | Append existing bindings with the directly specified Lua script `"