Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open ".tex" or "Makefile" by double-clicking on macOS finder #6492

Closed
anjos opened this issue Jul 23, 2023 · 2 comments
Closed

Cannot open ".tex" or "Makefile" by double-clicking on macOS finder #6492

anjos opened this issue Jul 23, 2023 · 2 comments
Labels

Comments

@anjos
Copy link

anjos commented Jul 23, 2023

Describe the bug
I setup kitty to be able to open files by double-clicking on the macOS finder. It launches kitty and my $EDITOR (which is Neovim). This works for most filetypes, except a few. Most notably ".tex" or "Makefile".

A clear and concise description of what the bug is.
Kitty complains with {'msg': 'Unknown URL type, cannot open:\n file:///Users/andre/work/biosignal/slides/vital-signs/intro.tex'}

To Reproduce
Steps to reproduce the behavior:

  1. Setup macOS to open .tex or Makefile files with kitty (to setup file associations, I used duti - brew install duti)
  2. Double-click on a .tex file.
  3. See the window come up and then go away

Further information
To debug this problem, I started kitty with kitty --dump-commands. I clicked on the file I wanted to open, and observed the output. At first, it stated:

draw No kitten named show_error

Would that kitten exist, that would have showed me the error, I guess. After implementing a sketchy kitten called show_error.py, I got to the message above about the unknown URL type.

So, I guess there are actually 2 issues? a) a missing show_error kitten somewhere, and b) a mechanism to associate filetypes with Kitty? Or may be I am doing something wrong?

Environment details

kitty 0.29.1 (a0341af3f8) created by Kovid Goyal
Darwin Andres-MacBook-Pro.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000 arm64
ProductName:		macOS ProductVersion:		13.4.1 ProductVersionExtra:	(c) BuildVersion:		22F770820d
Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /Users/andre/.config/kitty/kitty.conf

Config options different from defaults:
active_tab_font_style              (True, False)
allow_cloning                      yes
background_blur                    20
background_opacity                 0.9
bold_font                          SauceCodePro Nerd Font Bold
bold_italic_font                   SauceCodePro Nerd Font Bold Italic
copy_on_select                     clipboard
enable_audio_bell                  False
enabled_layouts                    ['vertical', 'tall:full_size=1;bias=50;mirrored=false', 'tall:full_size=2;bias=66;mirrored=false', 'horizontal']
env:
{'PATH': '/opt/homebrew/bin:/Users/andre/bin:/Users/andre/mamba/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin'}
exe_search_path:
{'/opt/homebrew/bin': '/opt/homebrew/bin'}
focus_follows_mouse                True
font_family                        SauceCodePro Nerd Font Medium
font_size                          13.8
inactive_tab_font_style            (False, True)
initial_window_height              (50, 'cells')
initial_window_width               (95, 'cells')
italic_font                        SauceCodePro Nerd Font Italic
kitty_mod                          shift+cmd
macos_quit_when_last_window_closed True
modify_font:
    cell_width 90%
    underline_position 1.5
    underline_thickness 120%
remember_window_size               False
resize_in_steps                    True
scrollback_lines                   10000
tab_bar_margin_height              TabBarMarginHeight(outer=4.0, inner=0)
tab_bar_margin_width               2.0
tab_bar_style                      custom
tab_title_template                 {fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{index}: [{tab.active_oldest_exe}] {tab.active_oldest_wd.split('/')[-1]}
visual_bell_duration               0.3
watcher:
{'watcher.py': 'watcher.py'}
window_margin_width                FloatEdges(left=1.0, top=1.0, right=1.0, bottom=1.0)
Added shortcuts:
	cmd+d →  launch --cwd=current --type=window --location=before
	cmd+e →  launch --cwd=current --type=window --location=before zsh -c 'eval "$(direnv hook zsh)"; exec direnv exec . nvim "$@"'
	cmd+f →  launch --type=window --stdin-source=@screen_scrollback less
Removed shortcuts:
	shift+cmd+- →  change_font_size all -2.0
	shift+cmd+= →  change_font_size all +2.0
	shift+cmd+[ →  previous_tab
	shift+cmd+] →  next_tab
	shift+cmd+w →  close_os_window
Changed shortcuts:
	kitty_mod+[ →  previous_tab
	kitty_mod+] →  next_tab
	kitty_mod+enter →  new_window_with_cwd
	kitty_mod+t →  new_tab_with_cwd
	kitty_mod+w →  close_os_window
Colors:
	active_tab_background              #2e5536   
	active_tab_foreground              #ffffff   
	color0                             #676965   
	color1                             #f44135   
	color10                            #5da602   
	color11                            #cfad00   
	color12                            #417ab3   
	color13                            #88658d   
	color14                            #00a7aa   
	color15                            #dbded8   
	color2                             #98e342   
	color3                             #fcea60   
	color4                             #83afd8   
	color5                             #bc93b6   
	color6                             #37e5e7   
	color7                             #f1f1ef   
	color8                             #4c4d4b   
	color9                             #d71e00   
	cursor                             #d0d0d0   
	foreground                         #fffefe   
	inactive_tab_background            #222222   
	inactive_tab_foreground            #888888   
	selection_background               #eecb8b   
	selection_foreground               #232323   
	tab_bar_background                 #222222   
	tab_bar_margin_color               #222222   

Important environment variables seen by the kitty process:
	PATH                                /Applications/kitty.app/Contents/MacOS:/Users/andre/bin:/Users/andre/mamba/condabin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
	LANG                                en_US.UTF-8
	VISUAL                              nvim
	EDITOR                              nvim
	SHELL                               /bin/zsh
	DISPLAY                             /private/tmp/com.apple.launchd.ojpYp8UPSf/org.xquartz:0
	USER                                andre
	LC_CTYPE                            UTF-8

Additional context
I tried this, and the results are the same.

@anjos anjos added the bug label Jul 23, 2023
@anjos
Copy link
Author

anjos commented Jul 25, 2023

Thanks for this fix, @kovidgoyal - that was quick!

What about the show_error issue that is somewhat related? Can you either provide a default kitten for that with kitty, or document how to provide one? Or should I open another issue for this?

@kovidgoyal
Copy link
Owner

its already fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants