kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
24.44k stars 980 forks source link

Error Setting Tab Title #494

Closed johnallen3d closed 6 years ago

johnallen3d commented 6 years ago

When I hit the default key combination to set a tab title I see the error below.

kitty version: 0.9.0 (installed via. release dmg) OS: MacOS OS version: 10.13.4 kitty config: map ctrl+shift+alt+t set_tab_title

error detail:

Unhandled exception running kitten:
Traceback (most recent call last):
  File "kitty/runner.py", line 71, in main
  File "kitty/runner.py", line 53, in launch
  File "kitty/main.py", line 88, in main
ImportError: dlopen(/Applications/kitty.app/Contents/MacOS/../Resources/Python/lib/python3.6/lib-dynload/readline.cpython-36m-darwin.so, 2): Library not loaded: @executable_path/../Frameworks/libreadline.6.dylib
  Referenced from: /Applications/kitty.app/Contents/Resources/Python/lib/python3.6/lib-dynload/readline.cpython-36m-darwin.so
  Reason: image not found
Press Enter to quit...
sle-odoo commented 6 years ago

@kovidgoyal Hello, thanks for the fix, it is now working fine when running kitty via python3 . in the source directory. However when i run make app and open the generated app file, the command is ignored and nothing is raised. Any idea if it's a bug or a configuration issue? Thank you

kovidgoyal commented 6 years ago

Try running

kitty +kitten ask

What does it output?

johnallen3d commented 6 years ago

Thank you for the quick fix! I'm in the same boat as @sle-odoo, if I run kitty from python3 . or a binstub it works great but not from the packaged kitty.app.

I tried running kitty +kitten ask and receive a prompt. I typed in hello and hit enter and received the following response:

> kitty +kitten ask
{'items': [], 'response': 'hello'}
kovidgoyal commented 6 years ago

You ran it from within kitty.app (i.e. in a terminal window run from kitty.app?) That is basically what is run to ask for the tab title.

johnallen3d commented 6 years ago

Yes, I launched a new instance of kitty from /Applications/kitty.app and that works find. However when I hit the key combo for setting the tab title ctrl+shift+alt+t nothing happens.

kovidgoyal commented 6 years ago

Look in console.app if any errors are reported or run /Applications/kitty.app/Contents/MacOS/kitty from another terminal and see if it prints out anything when trying to set the tab title.

johnallen3d commented 6 years ago

In Console.app I see the following after hitting the key combo:

Failed to send resize signal to child with id: 11 (children count: 1) (add queue: 0)

and there is a reference to fast_data_types.so.

If I run /Applications/kitty.app/Contents/MacOS/kitty from another terminal (iTerm.app) everything works as expected.

kovidgoyal commented 6 years ago

I'm at a loss, just use python3 . for the time being and with the next release you can use the released .dmg which works (sadly I can't test the make app version as by build machine is not capable of running kitty, only building it).

johnallen3d commented 6 years ago

No worries, thanks for troubleshooting with us and for the great app!

neverfox commented 6 years ago

I can confirm this as well. Installed via homebrew.

johnallen3d commented 6 years ago

Hello @kovidgoyal - I noticed the recent release of 0.9.1 so I installed the .dmg version this morning. Sadly I'm back to seeing the originally reported error from the version installed via the .dmg. I also re-built from source and experience the before described behavior (works w/ python3 ., nothing happens with .app version).

kovidgoyal commented 6 years ago

Strange, works fine for me when running from the released dmg. At this point someone that can reproduce it will have to debug further. When asking for the tab title kitty runs the ask kitten. This happens in kittens/runner.py in the launch function. Which in turn calls the main() function in kittens/ask/main.py

Stick some print statments in there to see what is happening. You can use

from kitty.utils import log_error
log_error('some text')

to print to Console.app or if you want to print to a file just do

print('some text', file=open('/tmp/kitty-log', 'a'))
johnallen3d commented 6 years ago

FYI - for others running into this issue. I've been using skhd (in combination with chunkwm) as an application launcher/switcher. I've found if I open the binary directly from the app folder this issue does not persist.

Here's my skhd mapping for example:

cmd + shift - i : open -a /Applications/Kitty.app/Contents/MacOS/kitty