Coder Social home page Coder Social logo

kovidgoyal / kitty Goto Github PK

View Code? Open in Web Editor NEW
22.0K 184.0 899.0 51.78 MB

Cross-platform, fast, feature-rich, GPU based terminal

Home Page: https://sw.kovidgoyal.net/kitty/

License: GNU General Public License v3.0

Python 40.73% C 26.90% Makefile 0.02% Objective-C 5.64% GLSL 0.47% Ruby 0.01% Nix 0.04% Shell 1.46% Vim Script 0.01% Go 24.72%
terminal-emulators opengl terminfo vt100 python c terminal kitty kitty-terminal go golang golang-application

kitty's Introduction

kitty's People

Contributors

bew avatar blueyed avatar ctrlcctrlv avatar dankamongmen avatar dependabot[bot] avatar eepp avatar egnor avatar elebow avatar eraserhd avatar itepechi avatar jamessan avatar jcla1 avatar jinliu avatar kennylevinsen avatar kovidgoyal avatar luflosi avatar m4rw3r avatar martinetd avatar maximbaz avatar nefsen402 avatar noomly avatar orki avatar page-down avatar ppwwyyxx avatar ricci avatar romkatv avatar sergei-grechanik avatar thedaemoness avatar trygveaa avatar ytang 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  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

kitty's Issues

Focusing error with glfw on wayland

I tried to install kitty on wayland (using the glfw-wayland package on archlinux), but I get the following error message:

 [glfw error]  Wayland: Focusing a window requires user interaction

I'm not sure how to debug this. Any clue?

Mouse selection broken

On a MacBook Pro 15" (2016) running macOS 10.12.3 (16D32) the selection coordinates are off. I can't click a link nor select text.

#43 did not fix it for me.

Requires Python >= 3.5

On one platform I use, it is difficult to set up and install Python >= 3.5, as it only comes with 3.4.X. How important is the hard requirement for 3.5 in this project?

Kitty does not respect Dvorak on OS X 10.11.6 (15G1212)

I use Dvorak keyboard layout and the shortcuts shown on https://github.com/kovidgoyal/kitty only work with the physical qwerty keys. Is there some setting I am missing? I am new to the project and I like this app. Thank you.

Steps to reproduce:

  1. Use Dvorak keyboard layout
  2. start kitty
  3. ctrl + shift + Enter to make new window
  4. ctrl + shift + w expected to close new window, but does not
  5. ctrl + shift + , closes new window as expected

Remove OSX specific window hints

This is the traceback I get:

Traceback (most recent call last):
  File "/usr/lib64/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "./__main__.py", line 7, in <module>
    main()
  File "./kitty/main.py", line 164, in main
    run_app(opts, args)
  File "./kitty/main.py", line 105, in run_app
    glewInit()
RuntimeError: OpenGL is missing the required ARB_texture_storage extension
[glfw error]  The GLFW library is not initialized

The test program demonstrates the issue.

#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <stdio.h>

int main() {
  if (!glfwInit()) {
    fprintf(stderr, "error init");
    return 1;
  }

  /* These are the offending lines */
  glfw_window_hint(GLFW_CONTEXT_VERSION_MAJOR, GL_VERSION[0])
  glfw_window_hint(GLFW_CONTEXT_VERSION_MINOR, GL_VERSION[1])
  glfw_window_hint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE)
  glfw_window_hint(GLFW_OPENGL_FORWARD_COMPAT, True)

  GLFWwindow* window = glfwCreateWindow(640, 480, "Example", NULL, NULL);
  if (!window) {
    fprintf(stderr, "error window");
    glfwTerminate();
    return 1;
  }
  glfwMakeContextCurrent(window);

  glewInit();

  printf("%d", GLEW_ARB_texture_storage);

  glfwTerminate();
  return 0;
}

If you leave the offending lines in, the program outputs 0. Otherwise it outputs 1.

Recommend change:

glfw_window_hint(GLFW_CONTEXT_VERSION_MAJOR, GL_VERSION[0])

if isosx:
    glfw_window_hint(GLFW_CONTEXT_VERSION_MAJOR, GL_VERSION[0])
    glfw_window_hint(GLFW_CONTEXT_VERSION_MINOR, GL_VERSION[1])
    glfw_window_hint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE)
    glfw_window_hint(GLFW_OPENGL_FORWARD_COMPAT, True)
    glfw_window_hint(GLFW_SAMPLES, 0)
    # OS X cannot handle 16bit stencil buffers
    glfw_window_hint(GLFW_STENCIL_BITS, 8)

Can't see anything

I've installed kitty to have a grasp of it, but no matter if I use the in-source version, or if I compile it to `linux-package', it doesn't respect colors in the configuration file, and all I'm shown is a black screen I can only type exit and press enter.

glfw' examples run fine though. This is the output of LIBGL_DEBUG=verbose MESA_DEBUG=1 bin/kitty':

libGL: Can't open configuration file /home/usr/.drirc: No such file or directory.
libGL: pci id for fd 6: 10de:0407, driver nouveau
libGL: OpenDriver: trying /usr/X11R6/lib/dri/tls/nouveau_dri.so
libGL: OpenDriver: trying /usr/X11R6/lib/dri/nouveau_dri.so
libGL: Can't open configuration file /home/usr/.drirc: No such file or directory.
libGL: Can't open configuration file /home/usr/.drirc: No such file or directory.
libGL: Using DRI3 for screen 0
Mesa: User error: GL_INVALID_ENUM in glTexBuffer(internalFormat GL_RGB32UI)

OpenType ligatures

I wonder if it's possible to enable – or to humbly request :) – the rendering of ligatures, as provided by many coding fonts (e.g. Hasklig)?

Window Size

Can I specify a window size in the config or anywhere?
The window is to tall for my liking

Zoom

When presenting, for example, it is desirable to quickly control the terminal font size without changing the global settings. Zoom is supported in Gnome Terminal, Konsole, Terminator and Termite, all with bindings of Ctrl-Shift-{+,-,0}, would be nice to have the same in Kitty.

line wraps insert new lines when copying

I have kitty open and I'll type in a command that is longer than the terminal is wide, so the line wraps. I press enter to run the command and it all works fine.

If I press the up key, zsh will go through history and pressing enter works.

But if I select with mouse, copy with Control-C, and paste with Control-V, new lines are inserted where the lines wrapped.
bad-kitty

OS X support

Issue to track the status of porting kitty to OS X.

Things needed to port:

  1. Fix any cross platform build issues when compiling the C code parts of kitty on OS X. Once it is building, setup continuous integration testing for OS X as well
  2. Replace use of xdpyinfo to get screen DPI with native OS X API (CGDisplayBounds and CGDisplayScreenSize?)
  3. Replace use of freetype+fontconfig to rasterize fonts with native OS X APIs (this is low priority since it is possible to setup fontconfig+freetype on OSX as well)

Instructions for running kitty on OS X

kitty now builds on OS X in Travis and all tests pass. A simple command to install the dependencies needed for kitty using brew:

brew update && brew install python3 && brew install glfw

Then simply follow the instructions in the README for building kitty from source.

RGB SGR sequences support (truecolor)

See https://gist.github.com/XVilka/8346728

  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"

The 256 colour palete is configured at start, and it's a 666 cube of
colours, each of them defined as a 24bit (888 rgb) colour.

This means that current support can only display 256 different colours
in the terminal, while truecolour means that you can display 16 milion
different colours at the same time.

Truecolour escape codes doesnt uses a colour palete. It just specifies the
colour itself.

Here's a test case:

printf "\x1b[38;2;255;100;0mTRUECOLOR\x1b[0m\n"
awk 'BEGIN{
    s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
    for (colnum = 0; colnum<77; colnum++) {
        r = 255-(colnum*255/76);
        g = (colnum*510/76);
        b = (colnum*255/76);
        if (g>255) g = 510-g;
        printf "\033[48;2;%d;%d;%dm", r,g,b;
        printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
        printf "%s\033[0m", substr(s,colnum+1,1);
    }
    printf "\n";
}'

Keep in mind that it is possible to use both ';' and ':' as parameters delimiter.

According to Wikipedia[1], this is only supported by xterm and konsole.

[1] https://en.wikipedia.org/wiki/ANSI_color

Currently, there is no support for the 24-bit colour descriptions in the terminfo/termcap database and utilites.
See the discussion thread here: https://lists.gnu.org/archive/html/bug-ncurses/2013-10/msg00007.html

Here are terminals discussions:

Now supporting truecolour

But there are bunch of libvte-based terminals for GTK2 so they are listed in the another section.

Also, while this one is not exactly a terminal, but a terminal replayer, it still worth mentioning:

Parsing ANSI colour sequences, but approximating them to 256 palette

Note about colour differences: a) RGB axes are not orthogonal, so you cannot use sqrt(R^2+G^2+B^2) formula, b) for colour differences there is more correct (but much more complex) CIEDE2000 formula (which may easily blow up performance if used blindly) [2].

[2] neovim/neovim#793 (comment)

Terminal multiplexers

  • tmux - starting from version 2.2 (support since 427b820...)
  • screen - has support in 'master' branch, need to be enabled (see 'truecolor' option)
  • pymux - tmux clone in pure Python (to enable truecolour run pymux with --truecolor option)
  • dvtm - not yet supporting True Colour martanne/dvtm#10

NOT supporting truecolour

[3] You can download patched version here https://github.com/rdebath/PuTTY

[4] You can download patched version here https://github.com/halcy/PuTTY

Here are another console programs discussions:

Supporting True Colour:

Not supporting True Colour:

Graphics rendering

Thoughts on implementing support for raster graphics in kitty (and terminals more generally). Out of curiosity, I spent some time looking into the existing imaging solutions in terminals, I found:

  1. https://github.com/saitoha/libsixel (seems the most advanced, but is fundamentally limited by backwards compatibility)
  2. https://www.iterm2.com/documentation-images.html (pretty basic, only supports displaying image files)
  3. https://git.enlightenment.org/apps/terminology.git/tree/README (seems to be file based so useless over ssh)
  4. https://github.com/withoutboats/notty (seems largely similar to (2))

My question is, why are we limiting ourselves to this image file display paradigm? Why not allow programs to render arbitrary pixel data in the terminal? The way I envision this working is:

  1. An escape code that allows programs running in the terminal to query the terminal for the current character cell size in pixels (this is similar to how querying for cursor position works)

  2. An escape code that allows the program running in the terminal to specify arbitrary pixel data to render at the current cursor position (in a single cell, think of it as sending a "graphical character" instead of text character). The pixel data can be binary for maximum efficiency (taking care to escape the C0 control codes for maximum robustness).

With these two primitives, programs will be able to draw arbitrary graphics (including image files) in terminals. This, to me, seems like a more general, and powerful, abstraction to build rather than just the ability to send image files in a few formats.

I am considering building this into kitty, so I thought, that before I do so, it would be good get some more opinions on the subject. Maybe get a little consensus going. Note that once this is built it is easy to support displaying image files on top of it, if needed.

A specification for this protocol is here: https://github.com/kovidgoyal/kitty/blob/gr/graphics-protocol.asciidoc

Progress on implementing the specification:

  • Loading image data
  • Displaying images (any loaded image can be displayed multiple times). This is a little tricky because we want support for z-index. In particular images with negative z-index must be rendered in between the cell background and the cell foreground. This allows text to be written on top of images.
  • Deleteing displayed images
  • Scrolling the images with the text
  • Implementing checks to prevent DoS attacks by loading too many images
  • Handling window resizes/font size chages
  • Handling reset (I plan to just have the terminal emulator delete all images on reset)
  • Handling the alternate screen (The alternate screens images will be cleared when switching to it, but the main screen must preserve the images when switching to/away from it).

Don't require glew 2.0

This is an extension of #36

The general changes added by glew 2.0 (aside from extensions that are not used in kitty) are:

Enhancements:

  • Forward context support added
  • OSMesa support added
  • EGL support added
  • MX support discontinued
  • Improved cmake build support

The top three are OSX specific. If I change setup.py to only require 1.13.0 and implement the patch in my previous issue where the window hints are only applied for isosx it works perfectly fine on my system.

UI

Kitty is nice at the moment, but is pretty daunting and gtk2 window frames are ugly. It would also fix the previous resize issue entirely, just by using GTK events instead of the current system.
I made a quick mockup in glade.
TermMockup.zip

blank black window

It builds, but when I run it, it just opens a blank black window. I am running archlinux.
These are the relevant installed package versions:
Python 3.5.2 (default, Nov 7 2016, 11:31:36)
glew 2.0.0-1
glfw-x11 3.2.1-1
freetype2 2.7.1-1
fontconfig 2.12.1-3
xorg-xdpyinfo 1.3.2-1
xsel 1.2.0.20160929-1
gcc (GCC) 6.2.1 20160830

Kitty builds, but fails tests.

Hi,

I am getting some odd behavior trying to build kitty. If you have a minute could you look at the following and see if you can spot what is going on?

On slackware64 14.1 I already had setup python3.5.1 which is working fine.

I removed glew1.9.0 and then built glew2.0 and tested it. Test programs work OK.

Then I cloned the glfw3 repository on github and built that. All seem to work fine and pass included tests. (BTW: I also tried the latest stable release with the same results).

I then built kitty and it compiled without error.

But when I tried to run test.py I got some undefined symbol errors. In order of appearance they were...

undefined symbol: XineramaQueryScreens
undefinded symbol: XcursorImageCreate
undefined symbol: XRRFreeScreenResources

... I fixed those by adding the following lines to setup.py around line 78...

ldflags.append('-lXinerama')
ldflags.append('-lXcursor')
ldflags.append('-lXrandr') 

After rerunning setup.py, kitty builds fine again, test.py now runs but produces the following errors...

======================================================================
FAIL: test_simple_parsing (kitty_tests.parser.TestParser)

Traceback (most recent call last):
File "/usr/local/src/kitty-master/kitty_tests/parser.py", line 60, in test_simple_parsing
self.ae(str(s.line(4)), '\u30cb\u30c1 ')
pb = functools.partial(<bound method TestParser.parse_bytes_dump of <kitty_tests.parser.TestParser testMethod=test_simple_parsing>>, <fast_data_types.Screen object at 0x27c1d10>)
s = <fast_data_types.Screen object at 0x27c1d10>
self = <kitty_tests.parser.TestParser testMethod=test_simple_parsing>
AssertionError: '\u30cb\u30c1 ' != '\u30cb\u30c1 '

  • \u30cb\u30c1
    ? --
  • \u30cb\u30c1

======================================================================
FAIL: test_char_manipulation (kitty_tests.screen.TestScreen)

Traceback (most recent call last):
File "/usr/local/src/kitty-master/kitty_tests/screen.py", line 129, in test_char_manipulation
self.ae(str(s.line(0)), ' x\u30b3 ')
init = <function TestScreen.test_char_manipulation..init at 0x7f1dbfa212f0>
s = <fast_data_types.Screen object at 0x27c1d10>
self = <kitty_tests.screen.TestScreen testMethod=test_char_manipulation>
AssertionError: ' x\u30b3\u30b3 ' != ' x\u30b3 '

  • x\u30b3\u30b3
    ? -
  • x\u30b3

======================================================================
FAIL: test_draw_char (kitty_tests.screen.TestScreen)

Traceback (most recent call last):
File "/usr/local/src/kitty-master/kitty_tests/screen.py", line 60, in test_draw_char
self.ae(str(s.line(0)), '\u30b3\u30b3x')
s = <fast_data_types.Screen object at 0x27c1d10>
self = <kitty_tests.screen.TestScreen testMethod=test_draw_char>
AssertionError: '\u30b3\u30b3x ' != '\u30b3\u30b3x'

  • \u30b3\u30b3x
    ? --
  • \u30b3\u30b3x

======================================================================
FAIL: test_utils (kitty_tests.datatypes.TestDataTypes)

Traceback (most recent call last):
File "/usr/local/src/kitty-master/kitty_tests/datatypes.py", line 268, in test_utils
self.ae(tuple(map(wcwidth, 'a1\0\u30b3')), (1, 1, 0, 2))
self = <kitty_tests.datatypes.TestDataTypes testMethod=test_utils>
AssertionError: Tuples differ: (1, 1, 0, 1) != (1, 1, 0, 2)

First differing element 3:
1
2

  • (1, 1, 0, 1)
    ? ^
  • (1, 1, 0, 2)
    ? ^

Ran 26 tests in 0.022s

FAILED (failures=4)

Running kitty just shows a blank window except for the cursor, text is not being drawn (BTW: The joystick test in GLFW3 draws text fine).

Also I noticed when I run kitty with the --session session.vim argument I get the following error...

Traceback (most recent call last):
File "/usr/lib64/python3.5/runpy.py", line 170, in _run_module_as_main
"main", mod_spec)
File "/usr/lib64/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/src/kitty-master/main.py", line 7, in
main()
File "/usr/local/src/kitty-master/kitty/main.py", line 147, in main
run_app(opts, args)
File "/usr/local/src/kitty-master/kitty/main.py", line 92, in run_app
boss = Boss(window, opts, args)
File "/usr/local/src/kitty-master/kitty/boss.py", line 70, in init
startup_session = create_session(opts, args)
File "/usr/local/src/kitty-master/kitty/session.py", line 88, in create_session
return parse_session(f.read(), opts)
File "/usr/local/src/kitty-master/kitty/session.py", line 78, in parse_session
raise ValueError('Unknown command in session file: {}'.format(cmd))
ValueError: Unknown command in session file: "
[glfw error] The GLFW library is not initialized

Any ideas what is causing the build to fail on my system?

Ctrl+w functionality

Expected behavior:
"Ctrl+w" combination usually removes the word before the cursor while on a terminal.
"Ctrl+w" on multiple windows vim session (i.e. vim -O file1 file2) allows you to jump between files.

What actually happens:
Ctrl+w is being ignored or not handled.

Thank you, keep up the great work!

Releasing mouse outside Kitty while dragging leaves the dragging mode stuck on

How to reproduce:

  • Have a wall of text in Kitty
  • Start selecting it
  • Holding the mouse, move it outside Kitty window
  • Release the mouse button
  • Move the mouse back inside

Actual behavior:

  • Once the mouse is back in, even though it's not pressed, the selection continues to update. The only way to leave selection mode is press and release the mouse button again.

Expected behavior:

  • The selection doesn't keep changing when moving the mouse back inside Kitty window.

Termite and XTerm continue tracking the mouse outside their windows, and copy it when the mouse button is released, even outside.

Keyboard issues

All combinations below are working properly in gnome-terminal and mate-terminal. Some of them are working in rxvt too.

Ctrl-arrow jumps over words, like Alt-f/w in bash. Common combination since DOS times.

Shift-arrow selects text as cursor moves, ctrl-shift-arrow jumps over word and selects it in mceditor.

Ctrl-pgup/pgdown jumps to top/bottom of the current screen in mcedit without moving it.

Shift-del (cut), ctrl-ins (copy), and shift-ins (paste) are parts of IBM CUA guidelines since 1988. Only shift-ins is necessary to implement, because mouse selection is automatic (no need for ctrl-ins) and shift-del (cut) has no sense. Unlike ctrl-shift-v, shift-ins is pasting mouse (selection) buffer. I.e. I can select a text with mouse in Firefox and then immediately insert it with shift-ins (or middle mouse button or shift-middle if mouse is overriden by an application) in terminal.

Middle mouse button pastes mouse buffer. Shift-mouse click works when terminal program overrides mouse behavior. mc and mcedit are examples.

Ctrl-arrow and ctrl-shift-arrow are huge productivity boosts for editing texts in commandline and mcedit.

Builds but fails: undefined symbol: XineramaQueryScreens

Kitty compiles fine, but running or testing it results in

ImportError: /tmp/kitty/kitty/fast_data_types.so: undefined symbol: XineramaQueryScreens

... even after following @Robgambrill's suggestion (in #23) to add the required linker flags:

ldflags.append('-lXinerama')
ldflags.append('-lXcursor')
ldflags.append('-lXrandr') 

All of those packages are installed, and I can't even find any reference to XineramaQueryScreens in the kitty source code. I would be grateful for any pointers.

Kitty shows font using oblique face vs. book face

I use 'Deja Vu Sans Mono for Powerline'; it comes in Book, Oblique, Bold, and Bold Oblique. When I specify the the family name that shows up in FontForge, e.g.:

font_family DejaVuSansMonoForPowerline Nerd Font

then kitty displays the Oblique font instead of the regular font (Book).

Any other combination I've tried results in a font that is too narrow to be used at all, so I'm not sure how to specify the Book style.

I tried:

font_family DejaVuSansMonoForPowerline Nerd Font Book
font_family DejaVuSansMonoForPowerlineNerdFontCompleteMono-Book  # (the font name shown in FontForge)

GLFW is not initialized

I tried to start kitty but I got:

python3 kitty
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "kitty/__main__.py", line 7, in <module>
    main()
  File "kitty/kitty/main.py", line 147, in main
    run_app(opts, args)
  File "kitty/kitty/main.py", line 92, in run_app
    boss = Boss(window, opts, args)
  File "kitty/kitty/boss.py", line 88, in __init__
    cell_size.width, cell_size.height = set_font_family(opts.font_family, opts.font_size)
  File "kitty/kitty/fonts/freetype.py", line 61, in set_font_family
    dpi = get_logical_dpi()
  File "kitty/kitty/utils.py", line 48, in get_logical_dpi
    raw = subprocess.check_output(['xdpyinfo']).decode('utf-8')
  File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 693, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'xdpyinfo'
[glfw error]  The GLFW library is not initialized

Font rendering in kitty is different from system's rendering

I'm using ArchLinux with Plasma 5.9 and I've attached a screenshot from Yakuake, a terminal that uses the Konsole engine. My problem is that the characters are too spaced out and fuzzy.

Left side is Kitty (installed from yaourt -S kitty-git), right side is Yakuake

kitty-to-yakuake

When selecting, whitespace at the end of lines disappears

When selecting text in Kitty, any whitespace present at the end of a line isn't considered part of the selection.

Steps to reproduce

  • Execute:
echo; echo 'one            '; echo 'two'; echo
  • Select and copy the whole output, including blank lines before "one" and after "two".
  • Paste elsewhere and examine the contents.

Expected result

(Note: spaces replaced by dots to illustrate)

one............
two

Actual result

one
two

Termite and XTerm both copy the spaces properly.

I think copying the output exactly is important for a terminal, because, for example, redirecting the above commands to a file will preserve spaces, and so should the terminal.

I started looking at fixing #58, but it seems a proper fix is impossible while Line doesn't retain this information.

Inline Image Support?

Hi! Are there any plans or goals to support inline images like in iTerm2? This is a feature I have been looking for in a terminal that works on linux for a couple of years.

Impossible to select whole line

When the following text is displayed in the terminal:

First line
Second line

It is impossible to select "First line" with the ending newline by itself.

If I drag the mouse to before "S" in "Second line", it is impossible not to select "S", so the smallest possible selection is First line\nS.

kitty-selection

If I drag the mouse past the end of "First line" (on the same line), "First line" is selected, followed by all the whitespace between the end of the line and mouse position. Note that other terminals in this case select First line\n, though selecting just First line is acceptable too.

Cannot build on Ubuntu 16.04 due to glew

After manually fixing issue #24 by adding ".group(0)" to setup.py line 75:

$ python3 setup.py build
glew >= 2.0.0 is required, found version: 1.13.0

It appears that 1.13.0 is the latest version available in Ubuntu 16.04 LTS.

Unable to compile using 'python3 setup.py build'

I get this error at the end.

In function ‘glfw_wait_events’:
/home/arkokoley/code/kitty/kitty/glfw.c:166:10: error: implicit declaration of function ‘glfwWaitEventsTimeout’ [-Wimplicit-function-declaration]
     else glfwWaitEventsTimeout(time);

GLSL 35633 compilation failed

GLSL 35633 compilation failed

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "kitty/__main__.py", line 7, in <module>
    main()
  File "kitty/kitty/main.py", line 147, in main
    run_app(opts, args)
  File "kitty/kitty/main.py", line 92, in run_app
    boss = Boss(window, opts, args)
  File "kitty/kitty/boss.py", line 100, in __init__
    self.cell_program = ShaderProgram(*cell_shader)
  File "kitty/kitty/shaders.py", line 181, in __init__
    vs_id = self.add_shader(vertex, GL_VERTEX_SHADER)
  File "kitty/kitty/shaders.py", line 232, in add_shader
    raise ValueError('GLSL {} compilation failed: \n{}'.format(shader_type, info.decode('utf-8')))
ValueError: GLSL 35633 compilation failed: 
0(29) : error C1020: invalid operands to "/"
0(29) : error C1020: invalid operands to "/"
0(29) : error C1020: invalid operands to "/"
0(33) : error C1020: invalid operands to "+"
0(34) : error C1020: invalid operands to "+"

Terminal bell and window manager hits

The visual bell (e.g. echo -e '\a') and the corresponding alert state for the window manager is a key feature for me, would it be diffucult to implement?

Terminal cursor remains active when window not focused

Expected behavior:
When the terminal is not being focused, the cursor should lose its internal color and only its border should be visible to denote inactivity.

What actually happens:
Cursor remains filled as if active window.

Thanks!

ld: library not found for -lhon.framework/Versions/3.5/Pyt

I am trying to compile kitty with Python 3.5.2 using python3 setup.y build, but it fails on this command:

gcc -Wall -O3 -pthread -shared /Users/addisonbean/misc/software/kitty/build/fast_data_types-charsets.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-colors.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-cursor.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-data-types.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-freetype.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-glfw.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-history.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-line-buf.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-line.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-parser.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-screen.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-sprites.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-tracker.c.o /Users/addisonbean/misc/software/kitty/build/fast_data_types-parser_dump.c.o -L/Users/addisonbean/.pyenv/versions/3.5.2/lib -lhon.framework/Versions/3.5/Pyt -L/usr/local/Cellar/glew/2.0.0/lib -lGLEW -L/usr/local/opt/freetype/lib -lfreetype -L/usr/local/lib -lglfw3 -o /Users/addisonbean/misc/software/kitty/kitty/fast_data_types.so

I am getting this error:

clang: warning: argument unused during compilation: '-pthread'
ld: library not found for -lhon.framework/Versions/3.5/Pyt
clang: error: linker command failed with exit code 1 (use -v to see invocation)

It looks like one of the options got truncated somehow. Any idea why this is happening? Thanks!

Quit suddenly when Chinese charaters are involved

OS: Debian 9 (Stretch)
Desktop Enviroment: LXQT
GLFW Verion: 3.2.1

With all dependent packages installed, the compilation was supper easy and kitty is a very nice terminal! Howerver, when I type ls in a directory with a flie whose name contains Chinese charaters, kitty just quits sharply.

I am not familliar to Python and C, and found nothing helpful by googling. Here is the stacktrace, and I missed something?

Unable to parse the pattern
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "~/Gits/APPS/kitty/__main__.py", line 7, in <module>
    main()
  File "~/Gits/APPS/kitty/kitty/main.py", line 175, in main
    run_app(opts, args)
  File "~/Gits/APPS/kitty/kitty/main.py", line 120, in run_app
    boss.render()
  File "~/Gits/APPS/kitty/kitty/boss.py", line 392, in render
    self.sprites.render_dirty_cells()
  File "~/Gits/APPS/kitty/kitty/shaders.py", line 93, in render_dirty_cells
    self.backend.render_dirty_cells(self.render_cell, self.send_to_gpu)
  File "~/Gits/APPS/kitty/kitty/shaders.py", line 87, in render_cell
    first, second = render_cell(text, bold, italic)
  File "~/Gits/APPS/kitty/kitty/fonts/render.py", line 41, in render_cell
    first, second = rc(text, bold, italic)
  File "~/Gits/APPS/kitty/kitty/fonts/freetype.py", line 176, in render_cell
    bitmap_char = render_char(text, bold, italic, width)
  File "~/Gits/APPS/kitty/kitty/fonts/freetype.py", line 97, in render_char
    font = font_for_char(text[0], bold, italic)
  File "~/Gits/APPS/kitty/kitty/fonts/freetype.py", line 43, in font_for_char
    return find_font_for_character(current_font_family_name, char, bold, italic)
  File "~/Gits/APPS/kitty/kitty/fonts/fontconfig.py", line 40, in find_font_for_character
    return get_font(q, bold, italic)
  File "~/Gits/APPS/kitty/kitty/fonts/fontconfig.py", line 21, in get_font
    raw = subprocess.check_output(['fc-match', query, '-f', '%{file}\x1e%{hinting}\x1e%{hintstyle}']).decode('utf-8')
  File "/usr/lib/python3.5/subprocess.py", line 316, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 398, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['fc-match', 'monospace:charset=597d:scalable=true:outline=true', '-f', '%{file}\x1e%{hinting}\x1e%{hintstyle}']' returned non-zero exit status 1
[glfw error]  The GLFW library is not initialized

The result of ls in Terminator:

$ ls
pulse-PKdhtXMmr18n                     您好
ssh-CNZEb3xJcOpv

Fails with unsupported pixel mode.

After correct build can`t start kitty, fails with error:

File "./kitty/fonts/freetype.py", line 125, in render_to_bitmap
    format(text, bitmap.pixel_mode)
ValueError: FreeType rendered the glyph for ' ' with an unsupported pixel mode: 0.

I tried different font_family(Hack, monospace, etc).
Problem in fonts, fontconfig or something different?

System info:

# cat /etc/issue
Debian GNU/Linux 8 \n \l

# dpkg -l|grep 'fontconfig\|glfw\|glew' 
ii  fontconfig                            2.11.0-6.3+deb8u1                    amd64        generic font configuration library - support binaries
ii  fontconfig-config                     2.11.0-6.3+deb8u1                    all          generic font configuration library - configuration
ii  fontconfig-infinality                 1-2                                  all          Configuration files for freetype-infinality
ii  glew-utils                            2.0.0-3                              amd64        OpenGL Extension Wrangler - utilities
ii  libglew-dev:amd64                     2.0.0-3                              amd64        OpenGL Extension Wrangler - development environment
ii  libglew1.10:amd64                     1.10.0-3                             amd64        OpenGL Extension Wrangler - runtime environment
ii  libglew2.0:amd64                      2.0.0-3                              amd64        OpenGL Extension Wrangler - runtime environment
ii  libglfw3:amd64                        3.2.1-1                              amd64        portable library for OpenGL, window and input (x11 libraries)
ii  libglfw3-dev:amd64                    3.2.1-1                              amd64        portable library for OpenGL, window and input (development files)

# /opt/python3.5/bin/python3.5 -V                                              
Python 3.5.3

# xdpyinfo -version
xdpyinfo 1.3.1

# xsel --version
xsel version 1.2.0 by Conrad Parker <[email protected]>

snippet selection to copy-paste buffer awareness

Usually, when working with several terminals, only one selection may be active and it is tied to the copy/paste buffer, somehow the text selected on other terminals becomes "unselected", in my WM when I select a string from a terminal I can paste it with the middle button on mouse (on both mouse buttons at the same time), currently kitty supports several highlighted snapshots to be active when several terminals are active. It becomes hard to know which text is actually bound to the copy/paste buffer.

Ctrl-Left and Ctrl-Down send strange key combinations

For Ctrl-Left and Ctrl-Down, Kitty sends key combinations that are out of alignment with the rest of the keys.

Here's the output from pressing Ctrl-Up, Ctrl-Down, Ctrl-Left and Ctrl-Right.

Kitty:

$ sed -n l
^[[1;5A
\033[1;5A$
^J
^J$
^H
^H$
^[[1;5C
\033[1;5C$ 

XTerm, Gnome Terminal and Termite:

$ sed -n l
^[[1;5A
\033[1;5A$
^[[1;5B
\033[1;5B$
^[[1;5D
\033[1;5D$
^[[1;5C
\033[1;5C$

This is Linux, X11, running under XMonad.

python3 setup.py build fails on line 75 with TypeError

I'm afraid I'm not totally sure how this is meant to work – maybe you want re.match(...).group(0) instead?

$ python3 setup.py build
Traceback (most recent call last):
  File "setup.py", line 197, in <module>
    main()
  File "setup.py", line 188, in main
    build(args)
  File "setup.py", line 163, in build
    init_env(args.debug, args.asan)
  File "setup.py", line 75, in init_env
    major = int(re.match(r'\d+', ver))
TypeError: int() argument must be a string, a bytes-like object or a number, not '_sre.SRE_Match'

Ubuntu 16.04, Python 3.5.2

Custom character spacing?

It would be a very nice readability enhancement if one could adjust the horizontal and vertical character spacing. Being able to configure the spacing between characters and lines to something a little bit tighter on horizontal axis and a little bit less tight on vertical axis would make text a lot more readable. I feel like there's some extra space between the characters the way they are rendered now?

Background opacity

I really miss this one, tried to look in the code, but there I only see cursor_opacity.
Any hints?
Thanks for the work.

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.