Skip to content

Conversation

@kdj0c
Copy link
Collaborator

@kdj0c kdj0c commented Dec 19, 2025

No description provided.

Jocelyn Falempe and others added 30 commits November 27, 2025 20:11
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
This option was removed long ago with commit
96b28e9 tsm: remove and depend on libtsm

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
There are two issues with v9.2.0:
- the version was not updated in meson.build
- the git tag is a lightweight tag, so ignored by git describe.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
That way, you can specify the right TERM value for agetty
using $$TERM in the systemd unit file.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Otherwise agetty will overwrite TERM with vt102

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
\x1B] is not recognized by sh or dash, but should be \033] instead.
It makes this script to fail to run a GUI with dash or sh.

Example:
    > sh
    $ printf "\x1B]setBackground\a"
    \x1B]setBackground$
    $ printf "\033]setBackground\a"
    $
This configuration is close to the current code, and minimize changes.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Fixed printf syntax to be portable and work in dash.
Got rid of useless `cat`s.

Signed-off-by: Vladimir-csp <4061903+Vladimir-csp@users.noreply.github.com>
Signed-off-by: Vladimir-csp <4061903+Vladimir-csp@users.noreply.github.com>
Use `inotifywait` to monitor foreground console change, if available, otherwise fallback to sleep.

Use `case` for control sequence selectors as it is more compact, elegant, and handy for potential future variant additions.

apply `shfmt -s -sr` formatting.

Signed-off-by: Vladimir-csp <4061903+Vladimir-csp@users.noreply.github.com>
Use single quotes to reduce escape ambiguity. There are no variables in those strings, now there is one less backslash, result is the same:
```
printf '%b' "\033Ptmux;\033\033]setBackground\a\033\\" | md5sum
printf '%b' '\033Ptmux;\033\033]setBackground\a\033\' | md5sum
```
```
f5a7f67be35dcd7b910e05f52cf1676a  -
f5a7f67be35dcd7b910e05f52cf1676a  -
```

Signed-off-by: Vladimir-csp <4061903+Vladimir-csp@users.noreply.github.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
fbdev doesn't support changing mode, so it has no effect there.
This prepares to switch to atomic modesetting.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Use the mode marked with the flag DRM_MODE_TYPE_PREFERRED as default
mode, instead of the first of the list.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Also simplify error handling

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
So it's easier to switch back to previous behavior if needed

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
drm2d directly calls the ioctl, but it's cleaner to use the libdrm's
helpers.
Addfb is deprecated for a long time, so use Addfb2, which allows to
specify the pixel format.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
drmModeAddFB is deprecated, as the pixel format can't be specified
Also gbm_bo_get_stride() replaced gbm_bo_get_pitch 13 years ago.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Mouse support was added in 9.2.0, and there are no issue raised about
it, so let's enable it by default.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
This commit adds a new configurable keyboard shortcut option --grab-reboot
that allows users to reboot the system directly from kmscon.

Features:
- Disabled by default (user must explicitly configure a key combination)
- Uses direct reboot() system call for reliability
- Calls sync() before reboot to ensure data safety
- Independent of --session-control flag
- Fully configurable key combination (e.g., <Ctrl><Alt>Delete)
- Includes comprehensive documentation in man pages

Implementation details:
- Added grab_reboot field to kmscon_conf_t structure
- Added seat_trigger_reboot() function using reboot(RB_AUTOBOOT)
- Integrated into seat-level input event handling
- Updated both kmscon.1 and kmscon.conf.1 man pages

Usage example:
  kmscon --grab-reboot='<Ctrl><Alt>Delete'
When an application enables mouse tracking (e.g., vim with 'set mouse=a'),
kmscon now forwards mouse wheel events to the application by converting
them to button events (button 4 for scroll up, button 5 for scroll down),
following the xterm mouse protocol.

Previously, wheel events were only handled by kmscon itself for scrolling
the terminal history, even when an application requested mouse tracking.

This change allows:
- Mouse wheel to scroll content in applications like vim, less, etc.
  when they enable mouse mode
- Mouse wheel to continue scrolling kmscon history when no application
  has enabled mouse tracking (shell prompt)

Changes:
- Add UTERM_WHEEL case to forward_pointer_event()
- Convert wheel events to button 4/5 according to xterm protocol
- Use local button variable to allow modification before forwarding
Adding \n at the end of the log string remove the function name,
and file line.
For generic message, this just clutter the logs.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
@kdj0c kdj0c closed this Dec 19, 2025
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.

4 participants