Giter Club home page Giter Club logo

Comments (38)

wezzynl avatar wezzynl commented on May 13, 2024 2

Awesome, I agree. Thank you very much. It builds correctly against Homebrew installed deps for me on the latest Sierra.

Also. The issue I mentioned earlier about prompt not correctly rendering is fixed when I set my terminal type to xterm-256color instead of xterm-kitty.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024 1

kitty now builds and runs on my OS X machine -- it does not render any characters, which is likely some OpenGL bug or the other, which will need investigation.

from kitty.

toomim avatar toomim commented on May 13, 2024 1

It builds AND renders characters on OSX for me!

image

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024 1

Where is your kitty.conf located. IIRC the default location on OSX is ~/Library/Preferences/kitty/kitty.conf if it is not there then use the --config option to specify its location

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024 1

Yeah, this would be caused by this commit: fa15b2d

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024 1

@shkm FYI kitty now builds against brew installed python3/glfw on Travis so it should be trivial to create a brew package for it.

from kitty.

somebehemoth avatar somebehemoth commented on May 13, 2024 1

Just want to thank @wezzynl. I was having issues with kitty and setting TERM completely fixed them for me (zsh-syntax-highlighting, tmux, ncurses apps like ncdu, newsbeuter, and anything else that didn't like TERM set to xterm-kitty).

from kitty.

somebehemoth avatar somebehemoth commented on May 13, 2024 1

Setting TERM in ~/Library/Preferences/kitty/kitty.conf works as expected. I did not understand that the problems I was experiencing related to TERM setting. This was user error. @wezzynl 's comment reminded me to check TERM value. iTerm2 uses "Profiles" to set TERM values so I didn't think of this setting in kitty.conf.

Thank you for making kitty.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024 1

This commit should fix the issue of the terminfo file not being picked up on OSX: 3cbb0b2

from kitty.

toomim avatar toomim commented on May 13, 2024

Here's a record of my OSX build attempt:

brew install glew                             # install glew
git clone https://github.com/glfw/glfw.git    # install glfw
cd glfw
cmake -DBUILD_SHARED_LIBS=ON .
make install
cd ..
git clone https://github.com/kovidgoyal/kitty # install kitty
cd kitty
# Then delete ", '-l' + lib" on line 78 of setup.py... and run:
python setup.py install

But I get this error:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I deleted the , '-l' + lib from setup.py because otherwise it errors with: ld: library not found for -lPython.framework/Versions/3.5/Python.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

I already committed code to handle that issue, see #2

from kitty.

toomim avatar toomim commented on May 13, 2024

Ok, I'm getting further now. I think your fix helped, thanks.

It also turns out homebrew only has glew version 1.3, so I installed version 2 with:

wget https://sourceforge.net/projects/glew/files/glew/2.0.0/glew-2.0.0.tgz/download
mv download glew.tgz
tar xzvf glew.tgz
cd glew-2.0.0/
make
sudo make install

And now running python3 setup.py build produces this strange error:

glew >= 2.0.0 is required, found version: 2.0.0

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

I guess pkg-config --atleast-version=2 glew is not working on OS X? I suppose it could be replaced by parsing the output of pkg-config --version manually on os x.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

Committed code to parse the version manually.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

kitty now builds on OS X in Travis and all tests pass. A simple script to install the dependencies needed by kitty to build:

#!/bin/sh
export SWBASE=/Users/Shared/buildbot/sw 
export SW=$SWBASE/sw 

mkdir -p $SW && \
curl https://download.calibre-ebook.com/travis/kitty/osx.tar.xz | tar xJ -C $SW

This will install the deps into /Users/Shared/buildbot/sw (unfortunately, for technical reasons the path cannot be changed). Once this is done, you can build kitty itself with:

/Users/Shared/buildbot/sw/sw/bin/python3 setup.py build

Run kitty after building completes with:

/Users/Shared/buildbot/sw/sw/bin/python3 .

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

Finished replacing fontconfig+freetype with OS X native APIs. This has had only the most rudimentary of testing, so YMMV

from kitty.

toomim avatar toomim commented on May 13, 2024

Cool! I got it to build and run, and crash:

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_GUARD
Exception Codes:       0x4000000100000004, 0x00007fff8d32d2a8

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	0x00007fffa03b383a close + 10
1   org.python.python             	0x00000001058062f7 os_closerange + 87
2   org.python.python             	0x0000000105736621 _PyCFunction_FastCallDict + 497
3   org.python.python             	0x00000001057b8327 call_function + 439
4   org.python.python             	0x00000001057b4b02 _PyEval_EvalFrameDefault + 27346
5   org.python.python             	0x00000001057b958d fast_function + 381
6   org.python.python             	0x00000001057b8301 call_function + 401
7   org.python.python             	0x00000001057b4b02 _PyEval_EvalFrameDefault + 27346
8   org.python.python             	0x00000001057b8d8f _PyEval_EvalCodeWithName + 2447
9   org.python.python             	0x00000001057adf74 PyEval_EvalCode + 100

This looks like it's something in OSX that detects an improperly-closed file descriptor: http://stackoverflow.com/questions/32429431/exc-guard-exception

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

Hmm, closerange is used in the forked process to ensure that no file descriptors other than the stdout/strdin/stderr are open. I'm assuming that some OS X system library is opening other file descriptors. Not sure what the solution for that is.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

I disabled closerange on OS X -- see if it helps.

from kitty.

toomim avatar toomim commented on May 13, 2024

Nope, getting the same error.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

One more place closerange() was called, although if the code has reached there it means something else went wrong earlier. There should be something printed to stderr (in any cae I have disabled that closerange() as well.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

Glad to hear it!

I only have an ancient OS X mac mini which I keep around for building calibre -- so it's likely some OpenGL function is failing there that works on newer machines. Hopefully it works for most people.

from kitty.

somebehemoth avatar somebehemoth commented on May 13, 2024

This is working for me on OS X 10.11.6 using your bash script. Thank you, it looks very nice.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

Cool, if it works for most people, I'll just forget about wasting time on figuring out the problem on my mini and just package it up into a dmg for easy installation. Fortunately, that is easy to do since I can re-use the build infrastructure I already have for calibre :) So those of you that want to run it on OS X please try it out and let me know if it works.

from kitty.

shkm avatar shkm commented on May 13, 2024

Alternatively / additionally, a brew (cask) formula would be great.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

I'm not going to get into the game of creating packages for the various distro systems, on linux or OS X. However, I just committed some code to make the linux-package work on OS X as well. So now all that a creator of an OS X package has to do is (in psedo-code)

install dependencies: python >= 3.5, glfw >= 3.2
python3 setup.py linux-package
cp -ra linux-package/* ${installation_prefix}/

Where installation_prefix would be whatever the package system uses (/usr/local I suppose). Then run kitty with ${installation_prefix}/bin/kitty

See for example the ARCH kitty package https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=kitty-git

from kitty.

wezzynl avatar wezzynl commented on May 13, 2024

I also got it running on macOS Sierra (10.12.2). I run on a Retina MacBook Pro and it looks like the rendering is not Retina. Fonts look a bit blocky/fuzzy.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

Hmm, hard to say as I cannot even get character rendering working on my ancient mac mini, let alone Retina! But, the first thing to check is if glfw is reporting the correct DPI, like this

kitty -c "from kitty.utils import *; from kitty.fast_data_types import *; glfw_init(); print(get_dpi())"

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

I can say that high dpi works fine on linux, where I use a 4K monitor (this was one of my motivations for developing kitty).

from kitty.

somebehemoth avatar somebehemoth commented on May 13, 2024

I am using MacBook Pro (Retina, 15-inch, Mid 2015) with 10.11.6 and the text looks great if a bit small. Kitty will not respond to font size changes I make to my local kitty.conf. I can successfully adjust font size by editing kovidgoyal/kitty/kitty.conf directly.

from kitty.

wezzynl avatar wezzynl commented on May 13, 2024

Output from kitty -c "from kitty.utils import *; from kitty.fast_data_types import *; glfw_init(); print(get_dpi())" is:

{'physical': (129.30909729003906, 129.4660186767578), 'logical': (129.30909729003906, 129.4660186767578)}

It seems however that the issue fixes itself if I first resize the window.. The buffer inside will start to flicker and turn red. When I then maximize the window, a couple of seconds later text re-appears and then looks correct. Before the resizing, the font is also smaller and seems like it's stretched horizontally.

Not sure if this is related to the rendering issue, but I use zsh and a themed "powerline" promt which seems to screw with the rendering. I get two prompts (it renders it twice) and when I type it'll render characters twice or even three times. When I execute bash which has just a simple prompt, that problem disappears.

from kitty.

toomim avatar toomim commented on May 13, 2024

I can confirm that the resolution increased in the newest git. In my old screenshot from git 2 days ago, each kitty pixel took up 4 of my macbook's retina pixels.

But now, everything rendered in the window uses retina pixels. Check it out, and notice that, compared to the old screenshot, the text is now smaller in comparison to the menubar:
image

from kitty.

shkm avatar shkm commented on May 13, 2024

Awesome work, @kovidgoyal! I'll take a look if I find some time and no one has done it yet.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

It's odd that you need to set TERM -- kitty sets the TERMINFO env var to point to the terminfo file for xterm-kitty

Does the OS X version of terminfo not support TERMINFO env vars? On linux, zsh syntax highlighting, tig, vim, tmux etc all work fine with TERMINFO=/path/to/kitty/terminfo TERM=xterm-kitty

Maybe if you copied over the terminfo file into /usr/share/terminfo it would work without needing to set TERM.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

The point is you should not need to change TERM at all, because kitty comes with a terminfo file of its own. But apparently, on OS X, ncurses/terminfo does not honor the TERMINFO environment variable. So run this instead,

tic /path/to/kitty/terminfo/kitty.terminfo

that will generate the terminfo database for kitty in ~/.terminfo and then you should not need to change TERM.

from kitty.

somebehemoth avatar somebehemoth commented on May 13, 2024

I can confirm this change worked as expected (thank you). Tmux, however, refuses to start unless I specify TERM to xterm-256color in kitty.conf. I don't view this as a problem per se, just sharing the information in case it is useful to anyone.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

It's been a long time since I used tmux, but I vaguely recall it used to have a hard-coded set of acceptable TERM values, maybe that is the issue.

from kitty.

kovidgoyal avatar kovidgoyal commented on May 13, 2024

Closing this issue since I have now made a kitty .dmg available on the releases page.

from kitty.

Related Issues (20)

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.