Coder Social home page Coder Social logo

kmscon's Introduction

= KMSCON =

Kmscon is a simple terminal emulator based on linux kernel mode setting (KMS).
It is an attempt to replace the in-kernel VT implementation with a userspace
console. See kmscon(1) man-page for usage information.

Website:
  http://www.freedesktop.org/wiki/Software/kmscon

== Requirements ==

  Kmscon requires the following software:
    - libtsm: terminal emulator state machine
        http://www.freedesktop.org/wiki/Software/kmscon/libtsm/
    - libudev: providing input, video, etc. device hotplug support (>=v172)
        http://www.freedesktop.org/wiki/Software/systemd/
    - libxkbcommon: providing internationalized keyboard handling
        http://xkbcommon.org/
    - libdrm: graphics access to DRM/KMS subsystem
    - linux-headers: linux kernel headers for ABI definitions

  Everything else is optional:

    For video output at least one of the following is required:
      - fbdev: For framebuffer video output the kernel headers must be installed
               and located in the default include path.
      - DRM: For unaccelerated drm output the "libdrm" library must be installed
             and accessible via pkg-config.
      - OpenGLES2: For accelerated video output via OpenGLESv2 the following must
                   be installed: libdrm, libgbm, egl, glesv2 (i.e., mesa)

    For font handling the following is required:
      - 8x16: The 8x16 font is a static built-in font which does not require
              external dependencies.
      - unifont: Static font without external dependencies.
      - pango: drawing text with pango
               Pango requires: glib, pango, fontconfig, freetype2 and more

    For multi-seat support you need the following packages:
      - systemd: Actually only the systemd-logind daemon and library is required.

== Download ==

Released tarballs can be found at:
  http://www.freedesktop.org/software/kmscon/releases

== Install ==

  To compile the kmscon binary, run the standard autotools commands:
    $ test -f ./configure || NOCONFIGURE=1 ./autogen.sh
    $ ./configure
    $ make
    $ make install
  To compile the test applications, run:
    $ make check

  If you want only a very basic kmscon program without any major dependencies,
  use:
    $ ./configure --with-video=fbdev,drm2d --with-renderers= --with-fonts=unifont --disable-multi-seat --with-sessions=dummy,terminal
  However, you will loose a lot of functionality by dropping all dependencies.

  The following configure options are available. If build-time dependencies
  cannot be satisfied, an option is automatically turned off, except if you
  explicitly enable it via command line:
    --enable-multi-seat: This requires the systemd-logind library to provide
                         multi-seat support for kmscon. [default: on]
    --enable-debug: Enable debug mode/messages [default: on]
    --enable-optimizations: Enable code optimizations [default: on]

  Backends for several subsystems in kmscon can be selected with the following
  options (all of them take a comma-separated list of backend names):
    --with-video: Video backens. Available backends are:
       - fbdev: Linux fbdev video backend
       - drm2d: Linux DRM software-rendering backend
       - drm3d: Linux DRM hardware-rendering backend
       Default is: fbdev,drm2d,drm3d
    --with-fonts: Font renderers. Available backends are:
       - unifont: Static built-in non-scalable font (Unicode Unifont)
       - pango: Pango based scalable font renderer
       Default is: unifont,pango
       The 8x16 backend is always built-in.
    --with-renderers: Console rendering backends. Available are:
       - bbulk: Simple 2D software-renderer (bulk-mode)
       - gltex: OpenGLESv2 accelerated renderer
       - pixman: pixman based renderer
       Default is: bbulk,gltex
       The bblit backend is always built-in.
    --with-sessions: Built in sessions. Available sessions are:
       - dummy: Dummy fallback session
       - terminal: Terminal-emulator sessions

== Running ==

  To get usage information, run:
    $ ./kmscon --help
  You can then run kmscon with:
    $ ./kmscon [options]

  For debug output use "--debug". For verbose output use "--verbose".
  With "--xkb-layout=<lang>" you can switch the keyboard layout.
  See "man kmscon" / kmscon(1) for more information.

== License ==

  This software is licensed under the terms of an MIT-like license. Please see
  ./COPYING for further information.

== FAQ ==

  Please see: http://www.freedesktop.org/wiki/Software/kmscon

== Contact ==

  This software is maintained by:
    David Herrmann <[email protected]>
  If you have any questions, do not hesitate to contact one of the maintainers.

kmscon's People

Contributors

bluetech avatar cl91 avatar falconindy avatar jwilk avatar keszybz avatar lkundrak avatar mmonaco avatar mslusarz avatar pwnissan avatar soreau avatar tedkotz avatar thierryreding avatar winspool avatar ysangkok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kmscon's Issues

`kmscon -l /bin/login` backspace broken

when I run kmscon -l /bin/login and press backspace while typing in login prompt ^H appears. eta^Ham is not the same as etam. This also applies to typing password (like whole password, nothing appears this time, but you cannot correct yourself). In bash backspace behaves as expected.

it doesn't use the system global fontconfig settings, but uses ~/.fonts.conf

kmscon ignores system global fontconfig settings. (/etc/fonts/...) while fbterm(another terminal emulator than kmscon) respects it.

I wanted kmscon to use NanumGothicCoding font but when it is launched by /etc/inittab it uses another ***ing ugly font, though it uses NanumGothicCoding when I launch it in agetty by typing "kmscon" while there is ~/.fonts.conf.

my /etc/inittab is written like :

# TERMINALS
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
#c2:2345:respawn:/sbin/agetty 38400 tty2 linux
#c3:2345:respawn:/sbin/agetty 38400 tty3 linux
#c4:2345:respawn:/sbin/agetty 38400 tty4 linux
#c5:2345:respawn:/sbin/agetty 38400 tty5 linux
#c6:2345:respawn:/sbin/agetty 38400 tty6 linux
#c1:12345:respawn:/usr/bin/kmscon --vt /dev/tty1
c2:2345:respawn:/usr/bin/kmscon --vt /dev/tty2
c3:2345:respawn:/usr/bin/kmscon --vt /dev/tty3
c4:2345:respawn:/usr/bin/kmscon --vt /dev/tty4
c5:2345:respawn:/usr/bin/kmscon --vt /dev/tty5
c6:2345:respawn:/usr/bin/kmscon --vt /dev/tty6

my /etc/fonts/conf.d/98-ko-dewr.conf is :

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
        <!--
                Private font directory
        <dir prefix="xdg">fonts</dir> -->

        <!-- Generic names -->
        <alias>
                <family>sans-serif</family>
                <prefer>
                        <family>UnDotum</family>
                </prefer>
        </alias>
        <alias>
                <family>serif</family>
                <prefer>
                        <family>UnBatang</family>
                </prefer>
        </alias>
        <alias>
                <family>monospace</family>
                <prefer>
                        <family>NanumGothicCoding</family>
                </prefer>
        </alias>

        <!-- disable hinting -->
<!--
        <match target="font">
                <test name="family">
                        <string>IPAPGothic</string>
                        <string>IPAPMincho</string>
                        <string>IPAGothic</string>
                        <string>IPAMincho</string>
                </test>
                <edit name="hinting" mode="assign">
                        <bool>false</bool>
                </edit>
        </match>
-->
<!--
        use UnBatang font when serif is requested for Korean
-->
<match>
        <test name="lang" compare="contains">
                <string>ko</string>
        </test>
        <test name="family">
                <string>serif</string>
        </test>
        <edit name="family" mode="prepend">
                <string>UnBatang</string>
        </edit>
</match>

<!--
        use UnDotum font when sans-serif is requested for Korean
-->
<match>
        <test name="lang" compare="contains">
                <string>ko</string>
        </test>
        <test name="family">
                <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend">
                <string>UnDotum</string>
        </edit>
</match>

<!--
        use NanumGothicCoding font when mono is requested for Korean
-->
<match>
        <test name="lang" compare="contains">
                <string>ko</string>
        </test>
        <test name="family">
                <string>monospace</string>
        </test>
        <edit name="family" mode="prepend">
                <string>NanumGothicCoding</string>
        </edit>
</match>

</fontconfig>

test environment : a gentoo box

Bulding kmscon as static binary fails

My build options are:

CFLAGS="-Os -static" LDFLAGS="-static" ./configure --disable-wlterm --disable-silent-rules --disable-multi-seat --with-video=fbdev --with-renderers=bbulk --with-fonts=unifont --with-sessions=dummy,terminal

But the binary after finishing build still have dynamic linked libs:

Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libudev.so.1]
0x00000001 (NEEDED) Shared library: [libpciaccess.so.0]
0x00000001 (NEEDED) Shared library: [libpthread.so.0]
0x00000001 (NEEDED) Shared library: [libxkbcommon.so.0]
0x00000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x00000001 (NEEDED) Shared library: [libc.so.6]

Only the binary is much bigger ~15MB. Only the libgcc_s.so doesn't exist as static lib on my system, all other are have .a files (udev too, I have build systemd with enabled static libs)

Not all characters have same width

Chinese characters are usually as twice wide as the Latin characters. It seems currently kmscon assumes that every character can be rendered in a space as wide as any ASCII character. This leads to a bug that only half of any wide-character is shown.

here is the related code in text_font_pango.c:
in manager_get_face:
str = "abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"@!"$%&/()=?}][{°^~+*#'<>|-_.:,;`´";
num = strlen(str);
pango_layout_set_text(layout, str, num);
pango_layout_get_pixel_extents(layout, NULL, &rec);

memcpy(&face->real_attr, &face->attr, sizeof(face->attr));
face->real_attr.height = rec.height;
face->real_attr.width = rec.width / num + 1;

and in get_glyph

pango_layout_line_get_pixel_extents(line, NULL, &rec);
glyph->buf.width = face->real_attr.width;
glyph->buf.height = face->real_attr.height;

Feature request: support alternate screen buffer

xterm (and compatible) have a feature called "Alternate Screen Buffer" that's used by most "full screen" terminal applications, like vi, less, man, mutt and screen - it's in the default termcap init/deinit called ti/te or rmcup/smcup. When the application starts, it switches to an alternate screen buffer, which doesn't have a scroll buffer, and the original screen is left untouched. When the application quits/suspends, the original buffer is restored as if the the application never existed on the terminal. There's only one alternate screen, they're not stacked or something like that.

Some application allow to disable this, because some people don't like it (vim has t_ti and t_te, less has LESS=X, and xterm has the titeInhibit resource). Also some terminal emulators like the linux VT don't support it at all.

Someone did an illustration here:
http://fixlog.blogspot.co.il/2006/09/stop-gnome-terminal-screen-clear.html

Here's the xterm reference:
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#The Alternate Screen Buffer
The relevant DEC control sequences are 47, 1047, 1048, 1049. Applications only use 1049 as far as I can tell.

Here's the xterm source code:
http://anonscm.debian.org/gitweb/?p=pkg-xorg/app/xterm.git;a=blob;f=charproc.c;h=ec5f498d714615595832a3764d31f8f77232fe54;hb=HEAD#l4340

This feature is a bit annoying to implement, I think, but should basically boil down to toggling two tsm_screen's. When I tried it I got into some trouble, but with some refactoring it seems doable.

Speed issue with Intel GM45

following up issue #17:

Regarding speed: What graphics card are you using? gltex should be way faster than any other renderer if you have a modern graphics card.

Intel GM45 on a ThinkPad X301. I think this called gen4.

On low-end machines (like my Intel-Atom N450 with integrated i915) the bblit renderer is still faster, indeed. The reasons why kernel-console or other consoles are faster is probably that they use partial-update-renderers (what I call them). That is, they redraw only the part of the screen that changed. kmscon however, always redraws the whole screen.

This cannot be the whole story. So I compare kmscon and fbterm. fbterm is faster in all respects. time dmesg is 0.26s on kmscon and 0.13s on fbterm, twice as fast. It’s quite striking for full-screen thingies that draw every character. There’s a package called caca-utils, that has cacademo and cacafire, which should be instructive. Mplayer also has a caca output module.
This is superslow in kmscon, it pegs one core only for kmscon.

Since fbterm works like the dumb fallback of kmscon it should not be so much faster.

Also the fbcon standard console is faster in one respect: for fullscreen drawing with character addressing. For normal scrolling like dmesg it is indeed slower: time dmesg is 1.9s

The reason is, that this ensures that I can realiably measure delays. In other words, the console will never be slower under any circumstances. If I implement partial-redraws (which I do intend!) I can never be sure that under other use-cases the terminal may be slower.

But the massive slowdown happens when every character is updated anyway, not for linear scrolling.

no bold characters

I've been putting off asking about this because the answer is probably obvious or something stupid that I'm missing.

When I'm in kmscon, I don't get bold characters. For example, notice and error messages from journalctl are not bold. Also, with lsblk and findmnt I do get the unicode line drawing characters, but they're the thinner alternatives.

No kmscon binary present after compile

With default configure options, there is not kmscon binary created that I can see.

The only binaries I see created are genshader* & genunifont*.

Finding and trying to use the ./configure --enable-kmscon option results in:

checking which render backends the user wants... bblit,bbulk,gltex (default)
checking which font backends the user wants... 8x16,freetype2,pango (default)
checking which sessions the user wants... dummy,terminal,cdev (default)
./configure: line 14329: xno: command not found
configure: error: eloop, TSM or uterm cannot be built for kmscon

Ctrl+Key doesn't work with non-ascii-like keyboard layouts

Suppose my --xkb-layout is "us,il", and the active layout is "il". This layout produces non-ASCII keysyms in the base level. In this case typing e.g. Ctrl+l (that is the lower case 'l' keyboard key / xkb keycode) should still clear the screen, etc. This works in xterm, urxvt and libvte (though strangely Ctrl is the only modifier which gets this special treatment).

libvte had these bugs about this issue:
https://bugzilla.gnome.org/show_bug.cgi?id=375112
https://bugzilla.gnome.org/show_bug.cgi?id=589557

They solved it here:
http://git.gnome.org/browse/vte/commit/?id=d64e28b3290aaf034ec37bbf4524ef78adbdfb2e
Which claims xterm does the same. It seem to work, so I think kmscon should do the same.

The equivalent loop in xkbcommon would look something like this:
https://gist.github.com/3833422
This is simple enough, and I've made sure it works as expected (it requires some relatively new API though). However the tsm_vte does not facilitate doing this directly like the libvte code above does (it doesn't have access to the xkb_state), so I didn't attempt a patch myself.

kmscon and /etc/securetty

Because kmscon dynamically allocates pty devices it makes /etc/securetty useless as an access control mechanism. Being able to make access decisions based on "someone is on a local console" is a useful feature, so it would be nice if there were some way to expose this information to PAM in the kmscon environment.

Can you add support for background image?

I currently use fbsplash to set a background image for virtual terminals.
But fbsplash is not maintained anymore and can't be compiled in new kernels.

I realized kmscon would be a good replacement if it supported background images.

--term xterm causes kmscon to get "stuck"

I have an issue where I start kmscon, where the session is something like this:

$ ls /
/ /home for bar baz

And then the prompt doesn't appear again. VT switching still works, so it's not some infinite loop. I bisected this to commit a0c644f which changed the default TERM to xterm-256color (but it also happens with just xterm). It doesn't happen with TERM=vt220.

After switching to another VT and attaching gdb to kmscon, the bt is:
#0 0xb773b424 in __kernel_vsyscall ()
#1 0xb747ee78 in __epoll_wait_nocancel () from /usr/lib/libc.so.6
#2 0xb7716a6e in ev_eloop_dispatch (loop=loop@entry=0x9e460c0, timeout=timeout@entry=-1) at src/eloop.c:808
#3 0xb771705e in ev_eloop_run (loop=0x9e460c0, timeout=timeout@entry=-1) at src/eloop.c:895
#4 0x0804b53d in main (argc=1, argv=0xbfe78e84) at src/main.c:624

So nothing helpful here. When attaching to the bash process, the bt is:
#0 0xb77b6424 in __kernel_vsyscall ()
#1 0xb763b6b3 in __read_nocancel () from /usr/lib/libc.so.6
#2 0xb7788b84 in rl_getc () from /usr/lib/libreadline.so.6
#3 0xb778941b in rl_read_key () from /usr/lib/libreadline.so.6
#4 0xb777302c in readline_internal_char () from /usr/lib/libreadline.so.6
#5 0xb7773585 in readline () from /usr/lib/libreadline.so.6
#6 0x0805cdca in ?? ()
#7 0x0805e90e in ?? ()
#8 0x080614e3 in ?? ()
#9 0x08064622 in yyparse ()
#10 0x0805c6cd in parse_command ()
#11 0x0805c78d in read_command ()
#12 0x0805c9d7 in reader_loop ()
#13 0x0805acfa in main ()

So it just waits for user input as well. So I don't know where to look (I can bisect further back with setting --term manually if you don't have a quick idea).

Since it clearly doesn't happen to other people, some details of this machine:

uname -a:
Linux fst 3.5.3-1-ARCH #1 SMP PREEMPT Sun Aug 26 08:15:06 UTC 2012 i686 GNU/Linux

packages:
extra/mesa 8.0.4-3 [installed]
extra/libdrm 2.4.39-1 [installed]
extra/intel-dri 8.0.4-3 [installed]

glxinfo:
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
GLX_OML_swap_method, GLX_SGI_swap_control, GLX_SGIS_multisample,
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
GLX_INTEL_swap_event
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_framebuffer_sRGB,
GLX_EXT_create_context_es2_profile, GLX_MESA_copy_sub_buffer,
GLX_MESA_multithread_makecurrent, GLX_MESA_swap_control,
GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGI_make_current_read,
GLX_SGI_swap_control, GLX_SGI_video_sync, GLX_SGIS_multisample,
GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
GLX_EXT_texture_from_pixmap, GLX_INTEL_swap_event
GLX version: 1.4
GLX extensions:
GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context,
GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_MESA_multithread_makecurrent, GLX_OML_swap_method,
GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group,
GLX_EXT_texture_from_pixmap
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 0x301)
OpenGL version string: 2.1 Mesa 8.0.4
OpenGL shading language version string: 1.20
OpenGL extensions:
GL_ARB_multisample, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color,
GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_copy_texture,
GL_EXT_polygon_offset, GL_EXT_subtexture, GL_EXT_texture_object,
GL_EXT_vertex_array, GL_EXT_compiled_vertex_array, GL_EXT_texture,
GL_EXT_texture3D, GL_IBM_rasterpos_clip, GL_ARB_point_parameters,
GL_EXT_draw_range_elements, GL_EXT_packed_pixels, GL_EXT_point_parameters,
GL_EXT_rescale_normal, GL_EXT_separate_specular_color,
GL_EXT_texture_edge_clamp, GL_SGIS_generate_mipmap,
GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp,
GL_SGIS_texture_lod, GL_ARB_multitexture, GL_IBM_multimode_draw_arrays,
GL_IBM_texture_mirrored_repeat, GL_ARB_texture_cube_map,
GL_ARB_texture_env_add, GL_ARB_transpose_matrix,
GL_EXT_blend_func_separate, GL_EXT_fog_coord, GL_EXT_multi_draw_arrays,
GL_EXT_secondary_color, GL_EXT_texture_env_add, GL_EXT_texture_lod_bias,
GL_INGR_blend_func_separate, GL_NV_blend_square, GL_NV_light_max_exponent,
GL_NV_texgen_reflection, GL_NV_texture_env_combine4,
GL_SUN_multi_draw_arrays, GL_ARB_texture_border_clamp,
GL_ARB_texture_compression, GL_EXT_framebuffer_object,
GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_MESA_window_pos,
GL_NV_packed_depth_stencil, GL_NV_texture_rectangle, GL_ARB_depth_texture,
GL_ARB_occlusion_query, GL_ARB_shadow, GL_ARB_texture_env_combine,
GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3,
GL_ARB_texture_mirrored_repeat, GL_ARB_window_pos,
GL_EXT_stencil_two_side, GL_EXT_texture_cube_map, GL_NV_fog_distance,
GL_APPLE_packed_pixels, GL_APPLE_vertex_array_object, GL_ARB_draw_buffers,
GL_ARB_fragment_program, GL_ARB_fragment_shader, GL_ARB_shader_objects,
GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ATI_draw_buffers,
GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_EXT_shadow_funcs,
GL_EXT_stencil_wrap, GL_MESA_pack_invert, GL_MESA_ycbcr_texture,
GL_NV_primitive_restart, GL_ARB_fragment_program_shadow,
GL_ARB_half_float_pixel, GL_ARB_occlusion_query2, GL_ARB_point_sprite,
GL_ARB_shading_language_100, GL_ARB_sync, GL_ARB_texture_non_power_of_two,
GL_ARB_vertex_buffer_object, GL_ATI_blend_equation_separate,
GL_EXT_blend_equation_separate, GL_OES_read_format,
GL_ARB_pixel_buffer_object, GL_ARB_texture_compression_rgtc,
GL_ARB_texture_float, GL_ARB_texture_rectangle,
GL_ATI_texture_compression_3dc, GL_EXT_packed_float,
GL_EXT_pixel_buffer_object, GL_EXT_texture_compression_rgtc,
GL_EXT_texture_mirror_clamp, GL_EXT_texture_rectangle,
GL_EXT_texture_sRGB, GL_EXT_texture_shared_exponent,
GL_ARB_framebuffer_object, GL_EXT_framebuffer_blit,
GL_EXT_framebuffer_multisample, GL_EXT_packed_depth_stencil,
GL_ARB_vertex_array_object, GL_ATI_separate_stencil,
GL_ATI_texture_mirror_once, GL_EXT_draw_buffers2, GL_EXT_draw_instanced,
GL_EXT_gpu_program_parameters, GL_EXT_texture_compression_latc,
GL_EXT_texture_sRGB_decode, GL_OES_EGL_image, GL_ARB_copy_buffer,
GL_ARB_draw_instanced, GL_ARB_half_float_vertex, GL_ARB_instanced_arrays,
GL_ARB_map_buffer_range, GL_ARB_texture_rg, GL_ARB_texture_swizzle,
GL_ARB_vertex_array_bgra, GL_EXT_separate_shader_objects,
GL_EXT_texture_swizzle, GL_EXT_vertex_array_bgra,
GL_NV_conditional_render, GL_AMD_draw_buffers_blend,
GL_ARB_ES2_compatibility, GL_ARB_draw_buffers_blend,
GL_ARB_draw_elements_base_vertex, GL_ARB_explicit_attrib_location,
GL_ARB_fragment_coord_conventions, GL_ARB_provoking_vertex,
GL_ARB_sampler_objects, GL_ARB_shader_texture_lod,
GL_ARB_vertex_type_2_10_10_10_rev, GL_EXT_provoking_vertex,
GL_EXT_texture_snorm, GL_MESA_texture_signed_rgba, GL_ARB_robustness,
GL_ARB_texture_storage

Interaction between console size and font size

First: I use a nVidia card with the nouveau driver. I only have one monitor to test on.

The console size is determined directly according to the chosen KMS mode. However, currently the screen buffer size is initialized statically to some default (80 cols x 24 rows). The font is scaled to match the screen size and the supposed size of a single cell in the console buffer.

This seems to be backwards to me. Since kmscon is a full screen app, what the user should pick is the font size, not the number of rows and columns. So, for example, instead of:
Mode: 1280 x 1024, Buffer 80 x 24 -> Font height 1024 / 24 = 42 (or something like that)
What should be calculated is:
Mode: 1280 x 1024, Font size (10pt) -> Buffer 160 x 70 (or something like that).

The only thing holding this back, as far as I can tell, is that the terminal actually supports multiple outputs. I can't test it, so I'm not sure how that is supposed to work. If I have two monitors, 1280x1024 and 800x600, how would you clone a single console to both of them in a reasonable way? Is that even expected to work?

I'll be happy to hear your thoughts.

Could you do a new release?

The latest release kmscon-6, which is packaged by Archlinux, does not have an important fix regarding multi-cell characters (commit 0de1de2, which happened after the release of kmscon-6). Could you do a new release so that Archlinux maintainer can package the fix?

Change KMSCON_FONT_DEFAULT_PPI to 96?

Hi David,
first let me say that I don't know what I'm talking about :)

Currently the default font size is 15. It was changed from 10, which appeared on the screen extremely small and illegible. Now in most applications I use (e.g. X, firefox, openoffice...) 10-11 is the "normal" size and 15 is pretty large. Changing the KMSCON_FONT_DEFAULT_PPI to 96 makes the font sizes appear like what I would expect from other applications.

I don't really understand exactly what effect that has. I read the code comments and you probably chose the 72 value for a reason. Just thought I'd ask if that's the intended behavior.

Thanks!
Ran

Building fails with FUSE version above 2.9.0

Minimal version of FUSE is 2.9.0, but version checking is not performed.

If version of FUSE less than 2.9.0, build fails on src/kmscon_cdev.c because it uses "fuse_buf" struct on line 1214, but in this case (version of FUSE less than 2.9.0) there is no in fuse/fuse_common.h

kmscon fails to show anything without --all-gpus

Hi David,

Starting ./kmscon (current HEAD: 9d2018f) doesn't show anything, besides some strange residual text content from a previous run on the top of the screen (e.g. some "ran $ ls" prompt cut in the vertical middle, which is probably what was there before).

The machine on which this happens has an nvidia 9600GT with the nvidia driver (yea, sorry). kmscon uses --fbdev here. Here is the lspci for it:

01:00.0 VGA compatible controller: NVIDIA Corporation G94 [GeForce 9600 GT](rev a1) (prog-if 00 [VGA controller])
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
Memory at f4000000 (64-bit, non-prefetchable) [size=32M]
I/O ports at c000 [size=128]
[virtual] Expansion ROM at f7000000 [disabled] [size=512K]
Capabilities:
Kernel driver in use: nvidia

There are no other GPUs on this machine. Kernel version is 3.5.4.

Bisection:
5be8972 is the first bad commit
commit 5be8972
Author: David Herrmann [email protected]
Date: Sat Oct 27 18:00:27 2012 +0200

kmscon: add --primary-gpu-only and --all-gpus options

By default, kmscon now only uses primary und auxiliary displays. All
uncategorized displays are ignored. This fixes problems with dual-GPU
systems.

--primary-gpu-only makes kmscon not use any auxiliary displays. --all-gpus
makes kmscon also use uncategorized displays.

Signed-off-by: David Herrmann <[email protected]>

:040000 040000 2540782870b28321cccd9f468c36324c0001f45b 1a2cfa8fd88f08160c2fc5d3f6649efbbae4d4a0 M src

Passing --all-gpus makes it work normally.

Here is a --debug log:
https://gist.github.com/3965344

non-dumb gltex doesn’t work

Running without --dumb I get a lot of debug spew.

sudo ./kmscon --xkb-layout de --xkb-variant nolatrash --font-engine pango --font-size 16 --font-name Pragmata

Then I switch to VT 1, there’s nothing to see, so I switch back and it outputted thousands of lines of warnings:

[0000.000000] NOTICE: kmscon Build #1 Aug 18 2012 17:40:12
[0000.024509] NOTICE: vt: using tty /dev/tty1
[0000.027251] INFO: new seat seat0
[0000.110814] INFO: video_drm: probing /dev/dri/card0
[0000.137614] INFO: video_drm: new drm device via /dev/dri/card0
[0000.140174] INFO: video: new device 0xb3ec90
[0001.114160] INFO: video: new display 0xb4e340
[0001.114236] INFO: video_drm: display 0xb4e340 DPMS is ON
[0001.114372] INFO: video_drm: activating display 0xb4e340 to 1440x900
[0001.142757] INFO: video_drm: setting DPMS of display 0xb4e340 to ON
[0001.253697] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)
[0001.253758] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)
[0001.253877] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)
[0001.254010] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)
[0001.254159] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)
[0001.254307] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)
[0001.254340] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)
[0001.254478] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)
[0001.254717] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)
[0001.254752] WARNING: text_gltex: cannot load glyph data into OpenGL texture (1280)

The last line repeats 10000 times even though I was on VT 1 only for a second.

Allow rotating console

Kernel command line fbcon=rotate:3, or else # echo 3 > /sys/class/graphics/fbcon/rotate_all rotates the linux console.

I think it's necessary for kmscon to have rotation ability at some point.

kmscon only works once on Thinkpad T40 (radeondrmfb)

I've just set up kmscon (7) under Arch Linux (kernel 3.7.9-2) on an IBM ThinkPad T40:

# cat /proc/fb
0 radeondrmfb

The first time kmscon launches it works correctly. If I switch to the kernel text console and then back to kmscon, the display is now corrupt (see this image).

After this point, launching any new kmscon instances will behave the same way.

TODO List

This is a list of items that are still to do. If you absolutely want to see some feature or if you have special notes for a feature on this list, please open a separate bug/feature-report for this single TODO-item only.

kmscon:

  • print /etc/issue on setup (try to be 100% compatible to agetty)
  • per output configuration
  • add input/video device blacklist
  • add proper .ini-style configuration file
  • make --gpus=primary fall back to other GPUs in single-gpu mode
  • reload configuration on SIGHUP
  • Avoid running multiple --listen instances on the same seat
  • Allow different processes to create cdev sessions
  • dynamic keyboard modifier detection
  • fail if a terminal cannot be started (at least in non-listen mode) so kmscon exits
  • read systemd-localed on startup to retrieve x11-keyboard layout
  • make systemd units use $(prefix) instead of hard-coding
  • install systemd units
  • background images
  • draw underline in text renderers
  • rework horrible shl_ring implementation

tsm:

  • support for VT220-style mouse-protocol
  • "fill" state of lines and buffers in tsm-screen
  • don't redraw buffer on keypress but on state-change
  • Partial redraws
  • multi-width characters (wcwidth())
  • Support Unicode combining marks
  • add c++ 'extern "C"' markers
  • configurable palette
  • "no bold" option

wlterm:

  • add support for window-title OSM and hook it up with wlt-toolkit
  • implement "snap-from-maximize" so you can "unmaximize" windows my moving them far enough

uterm:

  • make uterm_video_wake_up() remove displays on failure
  • handle SYN_DROPPED input-events
  • cursor support
  • delay device-probe if device changes seats (due to race-condition)
  • make udev optional
  • keep devices for unknown seats around until the seat shows up and then assign them
  • figure out dead-key support
  • make VT-switching keys configurable

kmscon with systemd and startx broken

On archlinux, I setup kmscon to replace agetty by creating a symlink in /etc/systemd/system/ between [email protected] and [email protected]. This works great as systemd now automatically starts kmscon instead of agetty.

Now typically I use startx in place on a tty. So when I launch xmonad through startx on tty1, it launches X on tty1 instead of creating allocating new tty. This is necessary to have startx work nicely with loginctl. If startx instead grabs a new tty, according to systemd, the login is no longer considered active.

So when running startx on tty1, I essentially run startx -- vt0

However it seems like running kmscon prevents access to the underlying virtual terminal. Running the above command yields the following error:

Fatal server error:
xf86OpenConsole: VT_ACTIVATE failed: No such device or address

Basically, afaik, X can't draw on top of kmscon like it could with agetty.

Incomplete backgrounds in `vim` and `mutt`

I don’t know if there’s a way to screenshot this, so here’s only a description to repro:

$ vim
:colo shine

kmscon doesn’t draw the background of fullscreen apps that set a non-back background color for the parts of the lines that have no foreground text. This is probably related to a reset of the background color that should not take place.

On the other hand I have this little script I wrote that works with background colors (The problem here is that cursor query returns a weird value, so it breaks): nyan.sh

Shift-tab is not working in kmscon tty terminal

On my environment shift+tab is not working in kmscon tty terminal.
In the normal gettty terminal during pressing "Ctrl+V Shifnt+Tab" in the terminal appreaed ^[[Z. In the kmscon nothing, even tab.

As I understarding in kmscon is using xkbd , not kbd as in normal tty. Any suggestion how to resolve this?

Thanks,
Vladimir

Can’t use Alt/Meta

Not sure if that has anything to do with termcap, but I cannot use things like <Alt>Period or <Alt>Backspace

Pango and Freetype2 backends force FT_PIXEL_MODE_GRAY

label: bikeshed

It would be cool it I weren’t forced to use gray antialias. My fontconfig sets rgba rendering and LCD filter. Is it wrong to assume that Pango can handle this automatically unless forced? Elsewhere I always get LCD filtered text with Pango.

Otherwise, I would prefer the built-in bitmap font. So either RGBA antialias or black and white.

Weird journalctl exit

In bare kmscon (without tmux)
journalctrl -b ends gracefully after pressing q
journalctl after pressing q acts for a longer moment like cat > /dev/null and takes 100% of CPU. Then it exits without any error

$PAGER / $SYSTEMD_PAGER are empty
systemd version - 196

Happy bug-hunting season!

kmscon cannot be compiled, related to libfont.

Cannot compile kmscon on Archlinux. Such error is appeared.

CC src/kmscon-kmscon_dummy.o
CC src/kmscon-kmscon_terminal.o
CC src/kmscon-kmscon_cdev.o
make[2]: *** No rule to make target libfont.la', needed bykmscon'. Stop.
make[2]: Leaving directory /tmp/packerbuild-0/kmscon-git/kmscon-git/src/kmscon-build' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/tmp/packerbuild-0/kmscon-git/kmscon-git/src/kmscon-build'
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
The build failed.

Feature: Dynamic font settings

It would be nice if the font face/size/etc could be set dynamically inside a kmscon session. I certainly find myself in situations where my selected font size turns out to be a bad fit for some information (e.g., I want to display a really wide table and want to crank the font size down).

-l or --login does not work

On Ubuntu 12.04, Intel Core i5 video GPU, when I run -l option I get:
ERROR: cannot initialize kmscon, error: -14, Bad address
(or very similar ;)).

./.libs/libuterm.so: undefined reference to `udev_device_has_tag'

I'm using udev-171 and receive the following error when I'm trying to compile kmscon-6:

libtool: link: x86_64-pc-linux-gnu-gcc -std=gnu99 -Wall -O0 -march=native -O2 -pipe -Wl,-O1 -o .libs/kmscon external/kmscon-htable.o src/kmscon-conf.o src/kmscon-log.o src/kmscon-pty.o src/kmscon-text.o src/kmscon-kmscon_seat.o src/kmscon-kmscon_conf.o src/kmscon-kmscon_main.o src/kmscon-kmscon_dummy.o src/kmscon-kmscon_terminal.o src/kmscon-kmscon_cdev.o src/kmscon-text_bblit.o src/kmscon-text_bbulk.o src/kmscon-text_gltex.o src/kmscon-static_gl_math.o src/kmscon-static_gl_shader.o src/kmscon-static_shaders.o -pthread -Wl,--as-needed ./.libs/libeloop.so ./.libs/libuterm.so /usr/lib64/libudev.so -lrt -lpciaccess -ldrm -lEGL -lgbm ./.libs/libtext-font.a /var/tmp/portage/x11-terms/kmscon-6/work/kmscon-6/.libs/libtsm.so -lpangoft2-1.0 -lpango-1.0 /usr/lib64/libfontconfig.so -lfreetype -lz -lbz2 -lexpat -lgobject-2.0 -lglib-2.0 -lpthread ./.libs/libtsm.so /usr/lib64/libxkbcommon.so -lfuse -lGLESv2 -pthread
./.libs/libuterm.so: undefined reference to udev_device_has_tag' collect2: ld returned 1 exit status make[2]: *** [kmscon] Error 1 make[2]: Leaving directory/var/tmp/portage/x11-terms/kmscon-6/work/kmscon-6'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/x11-terms/kmscon-6/work/kmscon-6'
make: *** [all] Error 2

The following configuration was used:

configure: Build configuration:

           prefix: /usr
      exec-prefix: ${prefix}
           libdir: /usr/lib64
       includedir: ${prefix}/include

Applications and Libraries:
kmscon: yes (yes: )
wlterm: no (no: enable-wlterm)
uterm: yes (yes: )
tsm: yes (yes: )
eloop: yes (yes: )

Miscellaneous Options:
debug: no (no: enable-debug)
optimizations: no (no: enable-optimizations)
multi-seat: no (no: enable-multi-seat)
hotplug: yes (yes: )
pciaccess: yes (yes: )
eloop-dbus: no (no: enable-eloop-dbus)

Video Backends:
fbdev: yes (yes: )
dumb drm: yes (yes: )
drm: yes (yes: )

Font Backends:
8x16: yes (yes: )
unifont: no (yes: )
freetype2: yes (yes: )
pango: yes (yes: )

Renderers:
bblit: yes (yes: )
bbulk: yes (yes: )
gltex: yes (yes: )

Session Types:
dummy: yes (yes: )
terminal: yes (yes: )
cdev: yes (yes: )

Export enviromental variable which would indicate that we are in KMSCON

One of the widely used ones is $COLORTERM

It's needed for eg. automatically spawning instance of tmux (which i don't want to do in gnome-terminal/Terminal)

Couple of terminals that sets COLORTERM — gnome-terminal, Terminal, rxvt-xpm
One that doesn't — terminology

Most of those which are running under X11 are using xterm-256color terminfo/termcap, so there was a need to differentiate them from the shell script in this way ;)

Segfault in link_to_scrollback() => free()

There is some nasty bug in the TSM-screen layer. It causes a SIGSEGV in free() so there might be some random memory corruption (or double free that isn't properly detected). I cannot narrow it down but it happens when setting the "perfect" combination of a bottom-margin + reszizing often + cat /dev/urandom.

Just as reminder that we need to check that again. If someone finds a way to reliably reproduce it, I will try narrowing it down further.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.