Skip to content

Add setBackground and setForeground escape codes#118

Merged
kdj0c merged 5 commits intoAetf:mainfrom
kdj0c:kms-launch-gui
Jul 30, 2025
Merged

Add setBackground and setForeground escape codes#118
kdj0c merged 5 commits intoAetf:mainfrom
kdj0c:kms-launch-gui

Conversation

@kdj0c
Copy link
Collaborator

@kdj0c kdj0c commented Jul 9, 2025

I finally fixed VT switching issues I had with #101
I also added suggestions like TMUX escape codes, and using $@ to be compatible with dash.

It is a workaround for #107

@kdj0c kdj0c force-pushed the kms-launch-gui branch from 3f36c8d to f27eee6 Compare July 9, 2025 12:55
@kdj0c kdj0c force-pushed the kms-launch-gui branch 2 times, most recently from 5f90693 to f293dba Compare July 11, 2025 12:06
@michael-oberpriller
Copy link

I suggest you add a check for /sys/class/tty/tty0/ for systems that do not have virtual terminals.

if [ -d /sys/class/tty/tty0 ]; then
    kms_tty=$(cat /sys/class/tty/tty0/active)
fi

Something like this would work. This prevents cat from give an error that the file does not exist. Otherwise everything looks good to me.

Jocelyn Falempe added 4 commits July 18, 2025 17:40
If you switch tty, and terminate the gui application, kmscon will
steal the VT.
So wait to switch back to the tty that it was launched on, before
sending setForeground command to kmscon.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
After running some fullscreen application, restore the VT terminal
mode. Otherwise kmscon will not receive SIGUSR1/2, and won't allow
VT switching.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Dash doesn't support ${@:1}, and $@ works the same.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
@kdj0c
Copy link
Collaborator Author

kdj0c commented Jul 18, 2025

@michael-oberpriller Thanks for the suggestion, I just pushed a new version.

If no other comments, I will merge it in 1 or 2 weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants