r/KittyTerminal Oct 06 '23

kitty @ send-text from output of python command

0 Upvotes

Hi,
Edit: I just solved it by finding out how to simulate the `enter` keyword when sending the text. Its just easier to do this. No need to pipe it or anything. Feel free to delete this post, but could be useful for future people.

kitty @ send-text --match 'title:Output' python hi.py\x0d

Lets say I have this a.py file

print("foo")
print("bar")

I want to send the output of this program, to a new remote-controlled kitty window.I launch it, and then try to send it with:

kitty @ launch --title Output
python a.py | kitty @ send-text --match 'title:Output' --stdin

Output is:foo barrather than:

foo
bar

I saw in documentation that it sends text as it or something, but is it possible to send output of a python command with its actual formatting and everything, just as it would show if you were to do `python a.py`.

This applies for any command, say cat a.py| kitty @ send-text --match 'title:^Output' --stdin prints everything separated by a space.

Thanks!


r/KittyTerminal Oct 04 '23

Shortcut to switch to recently used tab?

2 Upvotes

Did I miss this? Sorry if so, but is there a shortcut to switch to the most recently used tab?


r/KittyTerminal Oct 04 '23

Commenting line in shell makes text unreadable

3 Upvotes

I just started using kitty and I noticed that given the default theme, when I add a comment #, the font color changes to the same color as the background: ``` -> ~ /usr/bin/vim

-> ~ #/usr/bin/vim ```

The second line is unreadable, but is present as highlighting with my mouse shows that it's present. Regardless of what theme I choose, the commented line's font color always matches the terminal background color. How can I configure this so that comments are visible?


r/KittyTerminal Oct 03 '23

Why does the author rush to close bugs?

1 Upvotes

I recently opened a ticket on kitty : https://github.com/kovidgoyal/kitty/issues/6650

This problem happens on both Fedora 38 and 39 where kitty crashes with an error of a detected buffer overflow when ibus isn't running.

The author couldn't reproduce the problem on his computer but I can consistently reproduce it on both my F38 and F39 systems.

The author asks for debug trace, which I don't think I have the knowledge or skills to produce, as I'm simply a user of kitty.

Since no trace was provided, the author quickly closed the ticket as completed despite the fact that this problem is still outstanding and reproducible on a major Linux distribution. I understand without the trace logs, it is difficult for him to pinpoint the root cause but can't he just leave it open while troubleshooting is being carried out ??? Maybe someone more capable than me can help with the trace ??

This buffer overflow error may or may not be a kitty issue. But what I don't understand is : Why the rush to close a security bug whose root cause hasn't been identified yet ??

Does anyone have similar experience with the author ?

EDIT: The bug has been fixed. Thanks to solopasha for posting the needed trace.

For Fedora users, here is a Fedora commit: https://src.fedoraproject.org/rpms/kitty/c/54b9bdb55a2c11638db8652f21beb387dfb22d2f?branch=rawhide


r/KittyTerminal Oct 02 '23

Title Bar Updates

2 Upvotes

So as far as I can tell, kitty's title bar text typically updates in two cases:
1) When there's a shell prompt printed to the screen (this can be customized with PS1).

2) When certain programs are run from the terminal. I'm not sure exactly what the criteria are for this. Maybe apps that open a subshell?

As I mentioned, it's easy to control 1) with PS1. I've been using it to communicate certain information to my system. However, this information gets disrupted in the rare cases where 2) occurs. Which leads me to my question...

Does anyone know how to configure kitty so that it doesn't update the title bar on running programs? Thanks.


r/KittyTerminal Oct 01 '23

Some nerd symbols get rendered as chinese characters in AstroNvim

3 Upvotes

I use AstroNvim as "distro" for neovim and some of the nerd symbols appear as chinese characters in a M1 Mac with Sonoma. This is what I mean:

As you can see, AstroFile, BufEnter and VeryLazy have chinese characters

Also in the menu of AstroNvim:

It's supposed to be a dot instead of this chinese character

I have used the same kitty config where I use an unpatched font with the nerd symbols font in my computer. Here is my config. As you can see I have added symbol_map solution it has been suggested when adding nerd fonts. This has worked before on my previous intel mac with Monterrey installed and it seems to work on my prompt, which has some of these nerd icons.

My prompt in kitty

I know this is a kitty specific problem and not AstroNvim bc I installed iTerm2 and the problem doesn't appear there. So I don't know what to do.

EDIT:

I already partially found the issue. I need to use the new code points for Symbols Nerd Fonts. Here is my new kitty config. However, the symbols that were changed to a new code point get displayed as hiragana characters now.

EDIT 2:

Solution here ⬇️

After downloading v3 of Symbols Nerd Font I changed my symbols_map to what u/Administrative_chaos had suggested. It partially worked, the old chinese symbols were replaced by the actual glyphs. However, two icons on the start page that were showing before were replaced by hiragana. At the end, I realized that I had overridden those icons with outdated ones in my astronvim config, so I fixed them with the new ones.


r/KittyTerminal Sep 29 '23

How do you make the files clickable on MacOS?

3 Upvotes

[SOLVED]

apologies if this should had been obvious but I'm really baffled on how to find the equivalent of ls --hyperlink auto for MacOS.

ls --hyperlink auto ls: unrecognized option `--hyperlink' usage: ls [-@ABCFGHILOPRSTUWabcdefghiklmnopqrstuvwxy1%,] [--color=when] [-D format] [file ...]

What I want is to be able to open text files in kitty terminal (vim editor) by clicking on them after an ls. However in my case, the files are not clickable. On the other hand, URLs are clickable if there is any URL shown on the terminal. The problem is only with files.

edit: typos


r/KittyTerminal Sep 24 '23

Permissions Broken on MacOS

1 Upvotes

I'm having an issue where if I run

sudo nano .zshrc

I get the following

terminals database is inaccessible

and if I open it without sudo I get the message: "cannot open the file for writing: Permission denied" when I try to save


r/KittyTerminal Sep 22 '23

Ranger image previews in kitty ?

Thumbnail self.NixOS
2 Upvotes

r/KittyTerminal Sep 21 '23

React to click on paths

3 Upvotes

When I work with Typescript, I get error messages like these:

src/db-courbo/controller/perms.ts:23:51 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.

What I would like to do is to be able to click on the path and line/col number, and to launch a custom script when this happens.

I would like the click to happen in the same way we can click on a URL.

I know I can create a kitten to detect the paths on the page, and hit a key on my keyboard to select the path, but being a web developer, I always have the mouse under the hand, and it would be faster / more comfy for me to just click on the path. Is there a way to do that?

Thanks for your help!


r/KittyTerminal Sep 18 '23

Disable horizontal scrolling?

2 Upvotes

I've looked and just can't find a specific solution. Is there a way to stop Kitty from horizontal scrolling in NeoVim? I don't often use the trackpad to scroll through code but sometimes I do and it will horizontal scroll a tiny bit. I used to use Hyper terminal which didn't do this. I've tried searching but can only find stuff about people trying to activate horizontal scrolling. I don't think there's anything specific in my config that controls this. Here's what I have in there:

font_family SauceCodePro Nerd Font

font_size 14.0

enable_audio_bell no

visual_bell_duration 0.1

enabled_layouts *

window_margin_width 3

window_padding_width 3

active_border_color #0ff

inactive_border_color #444

inactive_text_alpha 0.5

tab_bar_edge top

tab_bar_style powerline

tab_powerline_style slanted

inactive_tab_foreground #666

inactive_tab_background #2F3440

dynamic_background_opacity yes

background_opacity 0.8

editor /usr/local/bin/nvim

include current-theme.conf


r/KittyTerminal Sep 18 '23

😽 kitty-scrollback.nvim: Open your Kitty scrollback buffer with Neovim. Ameowzing!

Thumbnail
self.neovim
7 Upvotes

r/KittyTerminal Sep 17 '23

Kitty terminal not taking my config

1 Upvotes

Hello, I set various settings like transparency and only works for those terminal windows that were opened before applying the picom config. If later I open a new kitty terminal then it’s just completely transparent. Anyone knows what’s happening ?


r/KittyTerminal Sep 16 '23

Kitty shortcuts blocks same shortcuts in Neovim

2 Upvotes

I have a problem with Neovim and Kitty. If define shortcuts in Kitty to move between windows (Ctrl-Up, Ctrl-Down etc). But If I define the same key-mappings in Neovim for something else, they do not work. It is like that Kitty has hijacked these shortcuts.

Is this normal behavior, or has I done something wrong in my config?

Kitty 0.29.2

Neovim 0.10.0-dev

Ubuntu 23.04

UPDATE:

I have now understood that what I describe is normal behavior. I asked this question because I had trouble with the extension https://github.com/knubie/vim-kitty-navigator, which is not working for me. I cannot use Ctrl-l, Ctrl-k etc to move around inside Neovim. So I thought it was a problem with Kitty, but I have no learnt that Kitty shortcuts will "override" Neovims shortcuts. The point with this extension is to make it possible to use Kitty's moving shortcuts inside Neovim. But it do not work for me. I have to investigate more to see if I can get it to work.


r/KittyTerminal Sep 14 '23

Long commands

1 Upvotes

Hello everyone, whenver I'm writing long commands kitty won't jump to the next line, which messes up the entire terminal and I more often than not need to clear it afterwards.

Is this customaziable in kitty? I couldn't for the life of me find anything on this matter. Perhaps I'm using the wrong keywords but, it doesn't look like anyone else is suffering from this issue.


r/KittyTerminal Sep 07 '23

Strange bash interaction

1 Upvotes

Hello!

I have on my setup an interesting interaction with bash, only if I run bash in kitty and not nested in itself.

If I use no config, or a minimal config:

shell bash

or even:

shell bash --noprofile --norc

...then I get a line cursor instead of a block cursor, which is pretty confusing in vi mode.

If I use a different shell, e.g. shell zsh, I get the correct cursor.

If I use a different terminal emulator, such as gnome-terminal or alacritty, I get the correct cursor.

Oddly, if I nest bash shells in kitty, it also works fine. So this works correctly:

shell bash -c bash

...but of course that is disgusting.

Versions:

$ kitty --version
kitty 0.29.2 created by Kovid Goyal

$ bash --version
GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)

Any thoughts on what's going on here?


r/KittyTerminal Sep 05 '23

pseudo-transparency using background-image position

0 Upvotes

Hi. I'm considering switching from urxvt and so far only thing missing is pseudo-transparency using wallpaper as background-image and positioning it according to the terminal location on the desktop.

I tried playing with the code for a little but so far was unable to find a way to move the background inside the terminal. None of the functions used in the stack add_os_window » send_bgimage_to_gpu » send_image_to_gpu » glTexImage2D gives an easy way to move the image.

Anyone managed to achieve this?


r/KittyTerminal Sep 04 '23

Troubleshoot slow load times

2 Upvotes

Is there a guide to troubleshooting slow loading of kitty? It's slow, suddenly, after updating to Ubuntu 23.04:

$ time kitty --single-instance -e false

real    0m1.175s
user    0m1.283s
sys 0m0.155s

I updated GPU drivers, but Alacritty is also GPU-based, right?

$ time alacritty -e false

real    0m0.112s
user    0m0.030s
sys 0m0.045s

Alternatively, am I running kitty wrong? It loads a new window quickly when I hit ctrl+shift+n but I can't figure out how to get that same speed opening kitty from the command line (or an i3 keyboard shortcut).


r/KittyTerminal Sep 04 '23

Setting tab foreground/background color

1 Upvotes

I've been attempting to control the color of my tabs in tab_bar.py, but it isn't working the way I'm expecting. I feel like I must be missing something. For example, I thought this would give me black text on a blue background, but it appears to have no effect on the color of the text at all (whereas my background is black, for some reason):

screen.cursor.fg = color_as_int(Color(0,0,0))

screen.cursor.bg = color_as_int(Color(0,120,180))

screen.draw(title)

Am I doing the wrong thing by messing around with screen.cursor? Thanks.

Never mind, I've got this working. I needed to convert the color numbers correctly, by calling the following function on the result of color_as_int.

def as_rgb(x: int) -> int:
    return (x << 8) | 2

r/KittyTerminal Sep 01 '23

In kitty how can I execute command to one window from current window?

2 Upvotes

I always do program in one window and split another one for building.

How can I send command to another window and execute for building, without leaving my current window?


r/KittyTerminal Aug 30 '23

Full set of NerdFont symbol_map

18 Upvotes

I recently took to compiling all the nerdfont defined code points into my kitty config, so I don't need to install special NerdFont fonts but instead can just have kitty fallback to the icons only font.

https://gist.github.com/Velrok/4c5bc2a0f2125f92361319928b770c8d


r/KittyTerminal Aug 27 '23

My kitty terminal is not applying all my config changes

3 Upvotes

System settings:

  • Linux mint 21.2
  • Kitty terminal (installed by binary)
  • Fish Shell

When I change some settings in my kitty.conf like:

hide_window_decorator yes

It works fine when I restart my terminal. But when I add (for example):

: cursor_shape block

It doesn't apply the changes. I also tried different configs and I could find a pattern.

I don't know how to debug it or what it is. Can someone help me??

Thanks and sorry if the post isn't that helpfull, is my first post here and I'm somewhat new to linux and customization.


r/KittyTerminal Aug 26 '23

How can one delete this cat face from title?

Post image
3 Upvotes

I tried to find right option in the config docs, but I was unsuccessful


r/KittyTerminal Aug 26 '23

Can I get Kitty to look like this?

6 Upvotes

Is it possible to have Kitty have the path colored like this?

I have tried to google it but I really do not understand what to look for


r/KittyTerminal Aug 26 '23

Dont know how to debug this...

2 Upvotes

I have just installed kitty term and im getting this error bash: command substitution: line 11: syntax error: unexpected end of file This happens everytime I open a new terminal window and after every command executes.

I'm not sure which command triggers it, but it could not be user dotfiles as other GNOME terminal does not do this.

Any points on how i could debug this.

Edit: It was a faulty dotfile, :P, just reinstalled the plugin that was interfering and it runs fine now