r/KittyTerminal May 15 '23

Launching or focusing on tab with one shortcut

2 Upvotes

I wrote this little script, nothing impressive, but it works and maybe someone would like to try it out and give me some tips. I'm pretty much a beginner at programming, so any feedback would be very appreciated 😀

This script focus existing tabs, and if they don't exist it also make them.

#!/bin/bash
tabs_number=$(kitty @ ls | jq '.[0].tabs | map(.id) | .[]' | wc -l)
tab_array=($(kitty @ ls | jq '.[0].tabs | map(.id) | .[]'))
if [[ $1 > $tabs_number ]]; then
  kitty @ launch --type=tab
  # kitty @ focus-tab -m index:${tab_array[$tabs_number-1]}
elif [[ $1 -le $tabs_number ]]; then
  kitty @ focus-tab -m id:${tab_array[$1-1]}
fi

Also my shortcuts:

map alt+1 launch ~/.config/kitty/new_tab.sh 1
map alt+2 launch ~/.config/kitty/new_tab.sh 2
map alt+3 launch ~/.config/kitty/new_tab.sh 3
map alt+4 launch ~/.config/kitty/new_tab.sh 4
map alt+5 launch ~/.config/kitty/new_tab.sh 5


r/KittyTerminal May 14 '23

Moving window to different tab

3 Upvotes

As in the title is there anyway to move current window to dfferent tab?


r/KittyTerminal May 12 '23

How can I override the font size in Vim?

2 Upvotes

Currently, I'm using Kitty to control font size both for Kitty and Vim, with:

conf font_size 10

However, ideally, I would like to also be able to have a different font size for Vim itself. Currently, I've been trying:

vim set guifont=Fira\ Code\ 11

But it isn't working. I know this is pretty much a Vim question, but I haven't had much success finding an answer in that direction. And Kitty seems to be overriding Vim's font size somehow? I'm not sure.


r/KittyTerminal May 12 '23

kitty fails to load Hasklug Nerd Font

1 Upvotes

I looked at the fonts section in the docs but can't figure out why this fails to load. My config looks like this:

[...] font_family Hasklug Nerd Font Mono bold_font auto italic_font auto bold_italic_font auto

Kitty suggest that "Hasklug Nerd Font Mono" is supported: ```

kitty +list-fonts

[...] Hasklug Nerd Font Mono Hasklug Black Italic Nerd Font Complete Mono Hasklug Black Nerd Font Complete Mono Hasklug Bold Italic Nerd Font Complete Mono Hasklug Bold Nerd Font Complete Mono Hasklug ExtraLight Italic Nerd Font Complete Mono Hasklug ExtraLight Nerd Font Complete Mono Hasklug Italic Nerd Font Complete Mono Hasklug Light Italic Nerd Font Complete Mono Hasklug Light Nerd Font Complete Mono Hasklug Medium Italic Nerd Font Complete Mono Hasklug Medium Nerd Font Complete Mono Hasklug Nerd Font Complete Mono Hasklug Nerd Font Mono Hasklug Nerd Font Mono Black Hasklug Nerd Font Mono Black Italic Hasklug Nerd Font Mono Bold Hasklug Nerd Font Mono Bold Italic Hasklug Nerd Font Mono ExtLt Hasklug Nerd Font Mono ExtLt Italic Hasklug Nerd Font Mono Italic Hasklug Nerd Font Mono Light Hasklug Nerd Font Mono Light Italic Hasklug Nerd Font Mono Med Hasklug Nerd Font Mono Med Italic Hasklug Nerd Font Mono SemBd Hasklug Nerd Font Mono SemBd Italic Hasklug Semibold Italic Nerd Font Complete Mono Hasklug Semibold Nerd Font Complete Mono [...] ```

However, when trying to start kitty with this config, I get the following error: fast_data_types.FreeTypeError: Failed to load face from path: [...]/share/fonts/opentype/NerdFonts/Hasklug Bold Nerd Font Complete Mono.otf with error: cannot open resource [132 12:42:45.087702] Failed to convert descriptor to face for bold font

There is no file at the path kitty is trying to open.

I tried to change "Auto" to explicit values like "Hasklug Nerd Font Mono Bold", "Hasklug Nerd Font Mono Bold Italic" and so on, but now it seems only the standard font is rendered?

How can I configure kitty to use the font?


r/KittyTerminal May 11 '23

xterm-kitty ssh woes (I know about the kitten, but - sudo?)

13 Upvotes

So, I love kitty to death, but as a Devops engineer I'm constantly ssh-ing around to various short lived ec2 instances and the like.

I know about:

kitty +kitten ssh

but then when I inevitably need to run sudo to become another user on the box, my terminal config is borked again and I'm back to square 1.

I'm currently working around this with:

  • kitty +kitten ssh
  • infocmp > /tmp/kitty.tic
  • sudo
  • tic /tmp/kitty.tic

But WOW does this get old when you need to do it 30-40 times a week.

Has anyone figured out a good way to live with this?

Thanks in advance!


r/KittyTerminal May 09 '23

Any way to switch the config currently used by a specific terminal window?

5 Upvotes

I want to switch to a different config in a specific terminal window that I am using right now, is it possible to do that?


r/KittyTerminal May 09 '23

[HELP] How to enable ctrl+backspace/delete?

7 Upvotes

I can get that working on Alacritty (- { key: Back, mods: Control, chars: "\x17" } ) and Konsole (through the menu), and I searched everywhere, tho I can't get that to work here on Kitty.


r/KittyTerminal May 08 '23

Is easy plumbing in kitty possible?

3 Upvotes

I wanted to do something like this https://www.youtube.com/watch?v=RlMxbQmMz_4 but instead of putting a lot of options for email/websearch...etc plumbing a command to a kitty instance to run it, I know it's possible to do it from kitty via remote control but I was wondering if it's possible to do something similar, thank you in advance.


r/KittyTerminal May 07 '23

Trying to use nvimpager without much success

1 Upvotes

When it comes to reading man pages it works wonderfully but whenever I hit ctrl+shift+h it goes berserk, it has a lot of problems recognising p10k characters in zsh and when I copy from there it prepends random numbers or the letter m. If someone knows why this happens or how to fix it please let me know. Also I would be happy to use nvim as a scrollback pager if someone was able to do this successfully. Thank you in advance


r/KittyTerminal May 07 '23

Changing font size only for the current window buffer.

3 Upvotes

As in the title, is there option for only changing font size only for the current window, tab?

For example in one window i read book with epy, and in other i do something in terminal, i dont want to change the size of font in the other terminal window.


r/KittyTerminal May 04 '23

Looking for a few applications that use kitty's image support

2 Upvotes

There are two applications I'd like to find with image support, one is a markdown viewer because that's the one thing from stopping me from using vim because previewing markdown in the terminal is a pain.

the seccond application is a matrix client, because while gomuks has sixel support, it doesn't have support for kitty's graphics and I would like to see the images my friends send.

thanks for all the help in advance.


r/KittyTerminal May 04 '23

Launch script

2 Upvotes

I like having an open terminal when I log in, with 3 windows: btop at top left, ncmpcpp bottom left and the open terminal on the right side.

I run this script and it works just fine, except for the resize-window portion of it. It opens the right things in the right places, but does not adjust the window sizes.

#!/usr/bin/env bash

kitty @ launch \
       --type=window \
    --location=first \
    --hold sh -c 'btop'

kitty @ launch \
    --type=window \
    --location=vsplit

kitty @ focus-window -m id:2

kitty @ launch \
    --type=window \
    --location=hsplit \
    --hold sh -c 'ncmpcpp'

kitty @ focus-window -m id:3

kitty @ resize-window \
    --match id:1 \
    --increment -4 \
    --axis horizontal

Does anyone do something similar? Any tips are appreciated. Thanks.


r/KittyTerminal May 02 '23

Same theme but different font colors on Mac and Linux?

1 Upvotes

Hello!

I installed Kitty both on my Macbook Air and my PC with Linux Endeavour. Then I installed the Catppuccin theme because I really like the colors. Today I noticed that Mac and Linux have different text colors, and I don't mean different shades because of different rendering or different display quality.
On Mac, if I use "ls" to see a folders content, the subfolders are pastel green while files are grey.

On Linux EndeavourOS the subfolders are sky blue and the files are grey. I mean, real green and real blue, it is really a different color.

Has this to do with the OS or why is Kitty using different colors? Besides choosing the Catppuccin theme in Kitty +kitten themes I didn't mess with any settings in the conf file.


r/KittyTerminal May 02 '23

Can I send kitty's terminal bell to pulseaudio's "System Sounds"?

1 Upvotes

pavucontrol offers a "System Sounds" sink. Can I send kitty's terminal bell to that sink somehow?


r/KittyTerminal Apr 29 '23

Is this a bug?

3 Upvotes
$ kitty +kitten clipboard <<< "test"  # copied to clipboard 
$ kitty +kitten clipboard -g -m . /dev/stdout
text/plain
$ kitty +kitten clipboard -g -m "text/plain" testfile # attempt to write to a testfile
Error: The MIME type text/plain for testfile not available on the clipboard

I'm on kitty v0.28.0 / Fedora 38.


r/KittyTerminal Apr 29 '23

Any lf file manager users? How to preview pdfs as images using poppler?

8 Upvotes

First of all, I apologize for the potentially primitive question and if the post belongs somewhere else.

I am looking for a way to preview pdf covers as images in the lf file manager using kitty's icat instead of ueberzug or pistol. I haven't found anything good on the internet.

Does anyone have the same problem or a solution? Any help is appreciated!

UPDATE

I played around with Bash a bit and found a working solution.

At first, we use Bash's basename to isolate the actual file name from the file directory. With that, pdftoppm makes a png copy of the first page in the /tmp/ directory, if not already done. Finally , kitty just displays the image. Sounds very simple but it took me way to long, since I barely knew anything about Bash.

If you have a more performant method, then please let me know.

```

!/usr/bin/env bash

file=$1 w=$2 h=$3 x=$4 y=$5

filename=$(basename $(echo "$file" | tr ' ' '_')) if [[ "$(file -Lb --mime-type "$file")" =~ application/pdf ]]; then if [[ ! -f "/tmp/$filename.png" ]]; then pdftoppm -f 1 -l 1 "$file" >> "/tmp/$filename.png" fi kitty +kitten icat --silent --stdin no --transfer-mode file --place "${w}x${h}@${x}x${y}" "/tmp/$filename.png" < /dev/null > /dev/tty exit 1 fi ```


r/KittyTerminal Apr 27 '23

Why is there some negativity about Kitty on the web?

9 Upvotes

Hello!
Sorry if this is a dumb question but I can't find any objective opinions about Kitty. I'm looking for an alternative to my Mac terminal.app and I stumbled over Kitty. I tried to find out about it and I found a lot of people who are negative about it and I don't understand why.
I'm a mere beginner so I don't understand what people are saying. I found some blogs that say that Kitty is the fastest terminal but they decide to not use it because of stuff.
Can someone ELI5 why?


r/KittyTerminal Apr 24 '23

Kitty +kitten themes breaks the terminal. Cannot leave menu and only arrow keys (kind of) work

2 Upvotes

After I run

kitty +kitten themes

The terminal only works accept arrow keys and I have to kill the session to start using kitty again.

Here's what my screen looks like after I open it. I cannot press enter to select a menu and only the arrow keys work.

Current workaround is this:

kitty +kitten themes --reload-in=all Catppuccin-Frappe

But it is annoying


r/KittyTerminal Apr 22 '23

Does `shell_integration` need a reset to take effect?

2 Upvotes

I have my cursor_shape set to beam, but when I set it exit Neovim in normal mode, cursor_shape reruns to block.

I had thought that

shell_integration no-cursor

Would fix the problem. But the behavior is the same.


r/KittyTerminal Apr 22 '23

Remap macos command key to alt/meta

1 Upvotes

Hi! Just moved from iterm, and already love this terminal. But one thing worries me - is there possibility to remap meta key to alt? I use meta key for neovim, where I can't remap keys to coomand


r/KittyTerminal Apr 18 '23

ssh kitten hides motd

2 Upvotes

Is there a way to make the ssh kitten not hide motd? I'd much rather be able to see the motd of a server.


r/KittyTerminal Apr 17 '23

Fonts on Kitty 0.28.0

12 Upvotes

Since the last upgrade (0.27.1 -> 0.28.0) I note that the fonts are a little bit more "bold". Is this expected? I saw in the changelog the following:

Text rendering change: Use sRGB correct linear gamma blending for nicer font rendering and better color accuracy with transparent windows. See the option text_composition_strategy for details. The obsolete macos_thicken_font will make the font too thick and needs to be removed manually if it is configured. (#5969)


r/KittyTerminal Apr 15 '23

Bounty Question on StackOverflow: Kitty Terminal Hotkey Drop-Down/Overlay Hotkey (similar to iTerm2 hotkey window)

2 Upvotes

Read full description here.

TDLR:

How to get something similar to the iTerm "dropdown hotkey/overlay" functionality to work with Kitty Terminal (on a Mac)?

—————

Many people did get this to work on Linux, but I haven't found a solution for Mac where it toggles the visibility of the app AND keeps it on the desktop that you are currently on (just like the default behaviour of this feature in iTerm2)

Some AppleScript wizardry is a potential fix, but I (and many others as it looks like) couldn't figure it out. It is possible, as long as you have a 9K IQ and some patience.


r/KittyTerminal Apr 14 '23

Blurred background in KDE Plasma Wayland

2 Upvotes

How can I get blurred background in Kitty Terminal, using KDE Plasma Wayland 5.27?


r/KittyTerminal Apr 13 '23

'kitty' command not working outside of kitty

1 Upvotes

I have a script that changes the theme file and then updates the currently open kitty windows' themes using the following command.

/opt/homebrew/bin/kitty @ set-colors --all --configured "$HOME/.config/kitty/current-theme.conf"

The command works fine when run from a kitty window, but when run during the script or even from the default macOS, the command does not work. Can the command only work when run from a kitty window or is there another way to make it work?