Implement left and right tab movement in console backend. This is used by
the VTE layer to interpret different VT escape sequences and the tabulator
character.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Protected erase means erasing parts of the screen but preventing protected
characters from being erase. Protecting a character is done by setting
character attributes similarly to colors and backgrounds. Both are reset
on hard erase, soft-reset or screen clearance.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is probably a copy/paste bug but we sent the wrong application cursor
key sequences. This is only visible in xterm-mode so nobody noticed until
now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We definitely do not need to check the unset parameters so shorten the
loop so unparsed parameters are not checked.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
ICH is used to insert characters into the current line. DCH is used to
delete characters from the current line. They act as described in vt220
manual.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
VT220 allows protecting attributes. That is, they are not erased by
special new erase-commands. The normal erase-commands still erase all
characters.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Implement TBC CSI which clears the current or all tab-stops. This is
according to VT220 rules.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Add three helpers to set and reset tab-stops. They will be used by the VTE
layer to add and remove tab-stops when requested by the application.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Whoops, current tab ruler turned out to be vertical. That's definitely not
what we want. Therefore, turn it around to be horizontal so we can
correctly move forward/backward in the console.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
On soft-reset we reset the console to the initial state but keep current
line-state. That is, scrollback and cursor position are kept but the
non-visible state is reset.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
As we might need dbus for inter-process-communication later, this adds a
very rudimentary dbus client integration for epoll-based loops.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The tab-ruler is used to set console tab-stops. We use an array with one
cell per column that is set to true if it is a tab-stop and false if it is
not.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instruct console code to reset the console margins to default values (that
is, destroy the margins) on console soft-reset.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
DECSC is used to save the current console state. DECRC can restore the
console to a previously saved state.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds two functions to retrieve x/y positions of the cursor. This can
be used to save and restore cursor positions.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We now automatically reopen the pty when the child process died. This will
most-often simply restart the shell or login program.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
There is no explicit call to reopen the underlying pty so we simply
force-close it before (re)-opening it. This will allow the UI to reopen a
pty when the child died.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This is the second release of kmscon. It's again a development release but
should now be good enough so it can run on any linux system.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
There is really no need to use these glib types here. They are relicts
from the time when we used the glib hashtable so we can safely replace
them now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
It really doesn't make sense to expect an integer here as memcmp() and
friends use an integer, too, but in reversed logic. So use bool to avoid
confusion.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This adds a new drop-in replacement for the glib hashtable implementation.
The hash table can be found at github: github.com/rustyrussel/ccan
It's licensed under the terms of the LGPL and perfect for our
implementation. Please see COPYING for license information.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If systemd is not used for multi-seat support, we simply fake-add seat
"seat0" and avoid looking for the "seat" tag. However, if devices still
use ID_SEAT, we still parse it but all other devices are taken for seat0
by default.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The previous fix incorrectly registered new signals always to the last
found signal which is definitely incorrect. Therefore, we now correctly
traverse the list and register new signals as new signals.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We need to return "true", not "false" if a mode is unknown. Otherwise, we
will block the VT subsystem.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
When building without DRM we should correctly clear the GBM and EGL flags.
Otherwise, we will be linking them either way.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Gcc warns about an uninitialized variable (which technically is correct).
However, there is really no way this can really happen. But to make gcc
happy (and to enhance code readability) we now depend on !sig whether the
list-search was successful.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Instead of defining them to nothing we now produce real code which
evaluates to "void", though. This allows us to use the macros whereever an
rvalue can be used.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
We initialize the variable to "true" to silence gcc warnings that we might
get an uninitialized variable (which we really cannot get here).
Anyway, in the future, if the number of types may increase, the correct
way to deal with unknown types is returning "true" so do this by default
now.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The 'M' CSI mode is used to delete lines. This implements this mode
similar to the "INSERT LINES" CSI.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
The IL CSI ('L') is used to insert a given number of lines at the current
cursor position. All lines below are moved down.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This removes the mode where we compiled uterm with OpenGL instead of
OpenGLES2 (it was broken anyway) and makes it fully optional now.
gl_shader.h is no longer compiled if OpenGL is not available and provides
dummy helpers instead.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This helps us moving opengl dependencies into a single source file so we
can easily disable it.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
If the uterm video object fails to initialize the DRM device, then we try
again with the dumb device. Only if both devices fail, we drop the device
and continue.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Nearly all drm drivers provide a GEM/TTM buffer backend called "dumb
buffers". These buffers can simply be mmap'ped like fbdev device so 2D
acceleration is available. This patch adds a backend to uterm-video that
uses these buffers. It is quite similar to the drm backend but removes all
the egl/gl/gles2 dependencies.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Remove all obsolete code and make it more readable. Nearly all features
can now be configured. However, the code doesn't work correctly if udev or
systemd is removed. That will be fixed soon, though.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Move all systemd dependencies into local helper functions so we can easily
make them optional.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
All udev-dependencies are now moved into uterm-monitor. This allows us to
easily make udev optional for hotplug-less systems or emergency setups.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>