Skip to content

Commit ea9c818

Browse files
authored
Merge pull request #827 from o-sdn-o/gui-bridge
Fix connections of type 'dtty'
2 parents ad64110 + 76be35c commit ea9c818

File tree

3 files changed

+59
-38
lines changed

3 files changed

+59
-38
lines changed

doc/architecture.md

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- [Output](#output)
1414
- [Desktop structure](#desktop-structure)
1515
- [Desktop objects](#desktop-objects)
16-
- [Usage scenarios](#usage-scenarios)
16+
- [Quick start](#quick-start)
1717
- [Local usage](#local-usage)
1818
- [Run vtm desktop](#run-vtm-desktop)
1919
- [Run Terminal Console standalone](#run-terminal-console-standalone)
@@ -27,7 +27,8 @@
2727
- [Run remote vtm desktop in DirectVT IO mode using inetd + ncat](#run-remote-vtm-desktop-in-directvt-io-mode-using-inetd--ncat-posix-only-unencrypted-for-private-use-only)
2828
- [Local standard I/O redirection using socat](#local-standard-io-redirection-using-socat-posix-only)
2929
- [Standard I/O stream monitoring](#standard-io-stream-monitoring)
30-
- [Desktop taskbar customization](#desktop-taskbar-customization)
30+
- [Desktop taskbar menu customization](#desktop-taskbar-menu-customization)
31+
- [Keyboard hacking](#keyboard-hacking)
3132
- [Desktop Live Panel](panel.md)
3233
- [Desktop objects and built-in applications](apps.md)
3334

@@ -321,7 +322,7 @@ Desktop Region Marker<br>`site` | A transparent resizable frame for ma
321322

322323
Do not confuse the `Desktop Applet` names with the desktop object names, even though they are the same literally, e.g. `vtty` and `term`. Desktop objects of the same name as Desktop Applets are wrappers for heavy desktop objects that should be launched in parallel vtm processes.
323324

324-
# Usage scenarios
325+
# Quick start
325326

326327
## Local usage
327328

@@ -464,47 +465,82 @@ The following examples assume that vtm is installed on both the local and remote
464465
# Note: Make sure `socat` is installed.
465466
```
466467

467-
468468
## Standard I/O stream monitoring
469469

470-
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.
470+
It is possible to visualize standard input/output streams of the running CUI applications. Launched in the `Log Monitor` mode (`vtm -m`), vtm will log the event stream of each terminal window with the `Logs` switch enabled.
471471

472472
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.
473473

474-
## Desktop taskbar customization
474+
## Desktop taskbar menu customization
475475

476476
The taskbar menu can be configured using a settings file `~/.config/vtm/settings.xml` (`%USERPROFILE%\.config\vtm\settings.xml` on Windows):
477477
```xml
478478
<config>
479479
<desktop>
480480
<taskbar>
481-
<!-- <item*/> --> <!-- Clear default item list -->
481+
<!-- <item*/> --> <!-- Uncomment to clear default item list. -->
482482
<item splitter label="Remote Access"/>
483483
484-
<item id="Run remote vtm desktop in DirectVT IO mode over SSH" type=dtty cmd="ssh user@server vtm"/>
485-
<item id="Run console app in remote terminal over SSH" type=dtty cmd="ssh user@server vtm -r term </path/to/console/app...>"/>
486-
<item id="Run console app remotely over SSH w/o extra UI" type=dtty cmd="ssh user@server vtm </path/to/console/app...>"/>
484+
<item id="Run remote vtm desktop in DirectVT IO mode over SSH" type="dtty" cmd="ssh user@server vtm"/>
485+
<item id="Run console app in remote terminal over SSH" type="dtty" cmd="ssh user@server vtm -r term </path/to/console/app...>"/>
486+
<item id="Run console app remotely over SSH w/o extra UI" type="dtty" cmd="ssh user@server vtm </path/to/console/app...>"/>
487487
488488
<item splitter label="Another Examples"/>
489489
490-
<item id="Far Manager" type=vtty cmd="far"/>
491-
<item id="Far Manager in terminal" type=dtvt cmd="$0 -r term far"/>
490+
<item id="Far Manager" type="vtty" cmd="far"/>
491+
<item id="Far Manager in terminal" type="dtvt" cmd="$0 -r term far"/>
492492
493-
<item id="Midnight Commander" type=vtty cmd="mc"/>
494-
<item id="Midnight Commander in terminal" type=dtvt cmd="$0 -r term mc"/>
493+
<item id="Midnight Commander" type="vtty" cmd="mc"/>
494+
<item id="Midnight Commander in terminal" type="dtvt" cmd="$0 -r term mc"/>
495495
496-
<item id="Remote cmd in terminal over SSH" type=dtty cmd="ssh user@server vtm -r term cmd"/>
497-
<item id="Remote cmd over SSH" type=dtty cmd="ssh user@server vtm cmd"/>
498-
<item id="Remote Far Manager over SSH" type=dtty cmd="ssh user@server vtm far"/>
499-
<item id="Remote wsl over SSH" type=dtty cmd="ssh user@server vtm wsl"/>
500-
<item id="Remote mc over SSH" type=dtty cmd="ssh user@server vtm mc"/>
501-
<item id="Remote wsl mc over SSH" type=dtty cmd="ssh user@server vtm wsl mc"/>
496+
<item id="Remote cmd in terminal over SSH" type="dtty" cmd="ssh user@server vtm -r term cmd"/>
497+
<item id="Remote cmd over SSH" type="dtty" cmd="ssh user@server vtm cmd"/>
498+
<item id="Remote Far Manager over SSH" type="dtty" cmd="ssh user@server vtm far"/>
499+
<item id="Remote wsl over SSH" type="dtty" cmd="ssh user@server vtm wsl"/>
500+
<item id="Remote mc over SSH" type="dtty" cmd="ssh user@server vtm mc"/>
501+
<item id="Remote wsl mc over SSH" type="dtty" cmd="ssh user@server vtm wsl mc"/>
502502
</taskbar>
503503
</desktop>
504504
</config>
505505
```
506506

507-
#### 28 Feb 2025: This functionality is under development.
507+
## Keyboard hacking
508+
509+
It is possible to emulate the tmux-like keyboard prefix approach by using a global variable in the Lua-scripting runtime space. As an example, the following configuration adds the keyboard shortcut `Ctrl+B` as a toggle for an additional keyboard mode (coupled with a user-defined boolean variable named `kbmodifier`) that allows windows to be moved directly using the arrow keys:
510+
511+
- `~/.config/vtm/settings.xml`:
512+
```xml
513+
<config>
514+
<events>
515+
<applet> <!-- Key bindings for the application window. -->
516+
<if_mod_on="if (not kbmodifier) then return; end;"/> <!-- `if_mod_on` macro definition. Do nothing if `kbmodifier` is false. -->
517+
<script="kbmodifier = not kbmodifier; log('kbmodifier=', kbmodifier);" on="Ctrl+B"/> <!-- Emulate tmux-like prefix key. The expression `log('kbmodifier=', kbmodifier);` is for debugging purposes only (the output is visible in the `Log Monitor`). -->
518+
<script=if_mod_on | MoveAppletLeft on="preview:LeftArrow" /> <!-- The ` | ` operator concatenates script fragments/macros. -->
519+
<script=if_mod_on | MoveAppletRight on="preview:RightArrow"/> <!-- Use "preview:..." to get the key event before the terminal/application. -->
520+
<script=if_mod_on | MoveAppletUp on="preview:UpArrow" /> <!-- When kbmodifier is true, you can move windows using the arrow keys. -->
521+
<script=if_mod_on | MoveAppletDown on="preview:DownArrow" /> <!-- Macros like `MoveApplet...` are defined in the default configuration. You can list them with `vtm -l`. -->
522+
<script=if_mod_on | MoveAppletTopLeft on="LeftArrow+UpArrow | UpArrow+LeftArrow" /> <!-- Simultaneous key presses should also be processed if supported. -->
523+
<script=if_mod_on | MoveAppletBottomLeft on="LeftArrow+DownArrow | DownArrow+LeftArrow" /> <!-- It is convenient to specify multiple keyboard shortcuts in one definition separated by `|`. -->
524+
<script=if_mod_on | MoveAppletTopRight on="RightArrow+UpArrow | UpArrow+RightArrow" />
525+
<script=if_mod_on | MoveAppletBottomRight on="RightArrow+DownArrow | DownArrow+RightArrow"/>
526+
<script=if_mod_on | IncreaseAppletWidth on="Ctrl+RightArrow" />
527+
<script=if_mod_on | DecreaseAppletWidth on="Ctrl+LeftArrow" />
528+
<script=if_mod_on | IncreaseAppletHeight on="Ctrl+DownArrow" />
529+
<script=if_mod_on | DecreaseAppletHeight on="Ctrl+UpArrow" />
530+
</applet>
531+
</events>
532+
</config>
533+
```
534+
535+
# Desktop Live Panel
536+
537+
- [Desktop Live Panel](panel.md)
538+
539+
# Desktop objects and built-in applications
540+
541+
- [Desktop objects and built-in applications](apps.md)
542+
543+
#### 28 Feb 2025: The following functionality is under development:
508544
509545
Additionally, the taskbar menu of the running desktop can be configured using shell piped redirection by sending script commands to the running vtm desktop:
510546
```
@@ -527,11 +563,3 @@ echo "vtm.taskbar.Selected('Term')" | vtm
527563
# Run window with terminals
528564
echo "vtm.desktop.Run({ id='Tile' })" | vtm
529565
```
530-
531-
# Desktop Live Panel
532-
533-
- [Desktop Live Panel](panel.md)
534-
535-
# Desktop objects and built-in applications
536-
537-
- [Desktop objects and built-in applications](apps.md)

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Linux platform notes:
3939
4040
# Documentation
4141
42+
- [Quick start](doc/architecture.md#quick-start)
4243
- [Architecture](doc/architecture.md)
4344
- [Building from source](doc/build.md)
4445
- [Command-line options](doc/command-line-options.md)

src/netxs/desktopio/application.hpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace netxs::app
2222

2323
namespace netxs::app::shared
2424
{
25-
static const auto version = "v2025.10.15";
25+
static const auto version = "v2025.10.16";
2626
static const auto repository = "https://github.com/directvt/vtm";
2727
static const auto usr_config = "~/.config/vtm/settings.xml"s;
2828
static const auto sys_config = "/etc/vtm/settings.xml"s;
@@ -642,14 +642,6 @@ namespace netxs::app::shared
642642
return [&](eccc appcfg, settings& config)
643643
{
644644
auto applet_ptr = builder_proc(appcfg, config);
645-
auto& applet = *applet_ptr;
646-
applet.LISTEN(tier::anycast, e2::form::upon::started, root_ptr)
647-
{
648-
applet.base::enqueue([&](auto&)
649-
{
650-
applet.base::signal(tier::release, e2::form::upon::started, root_ptr); // Fire a release started event after all initializations.
651-
});
652-
};
653645
return applet_ptr;
654646
};
655647
}

0 commit comments

Comments
 (0)