kitten icat: Failed to open controlling terminal #7275
-
Is there a way to use kitten icat inside an ncurses application? Using kitten icat --align left "$img_path" Per this thread I've also tried the following commands which result in different errors, kitten @ --to=$KITTY_LISTEN_ON icat --align left "$img_path"
# Error: icat is not a known subcommand for @. Use --help to get a list of valid subcommands.
kitten icat --align left "$img_path" @ --to=$KITTY_LISTEN_ON
# Error: Failed to open controlling terminal with error: open /dev/tty: device not configured thanks in advance for any help or advice |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 10 replies
-
On Wed, Mar 27, 2024 at 08:18:32PM -0700, iambumblehead wrote:
Is there a way to use kitten icat inside an ncurses application?
Yes, just run it, and make sure your application is not doing any IO
with /dev/tty while running it.
Using `kitten icat` inside an ncurses application here gives the error `Failed to open controlling terminal`
```bash
kitten icat --align left "$img_path";;
```
That's not an ncurses application, thats probably nvim, which works in
client server mode and has no access to the tty. If you want to display
images in nvim use images.nvim
Per [this thread](#2426 (comment)) I've also tried the following commands which result in different errors,
```bash
kitten @ --to=$KITTY_LISTEN_ON icat --align left "$img_path";;
# Error: icat is not a known subcommand for @. Use --help to get a list of valid subcommands.
kitten icat --align left "$img_path" @ --to=$KITTY_LISTEN_ON ;;
# Error: Failed to open controlling terminal with error: open /dev/tty: device not configured
```
Remote control cant be used to display images,
see https://sw.kovidgoyal.net/kitty/remote-control/
|
Beta Was this translation helpful? Give feedback.
-
On Wed, Mar 27, 2024 at 08:29:00PM -0700, iambumblehead wrote:
the parent application is vifm and basically this same issue is discussed at stackoverflow here https://stackoverflow.com/questions/76024179/issue-with-previewing-images-in-vifm-on-wayland-with-kitty-on-arch-linux
Then you need to get vifm to allow you to run processes with access to
the terminal device. Or get it to suppor thte kitty image protocol
natively.
|
Beta Was this translation helpful? Give feedback.
-
On Wed, Mar 27, 2024 at 08:29:00PM -0700, iambumblehead wrote:
the parent application is vifm and basically this same issue is discussed at stackoverflow here https://stackoverflow.com/questions/76024179/issue-with-previewing-images-in-vifm-on-wayland-with-kitty-on-arch-linux
Oh and that stack overflow answer is incomplete. You dont need a terminal
if you can pass the window dimensions manually, as demonstrated by
zsh -c 'setsid kitten icat --use-window-size 100,30,3000,2000 --place ***@***.*** --transfer-mode=file logo/kitty.png'
You will of course need to replace the various dimensions and the
filename. But as I said in my previous reply, its easier just to use the
tty.
|
Beta Was this translation helpful? Give feedback.
-
On Wed, Mar 27, 2024 at 10:03:16PM -0700, iambumblehead wrote:
removing the /dev/tty redirections (either one or both) results in an error
```bash
kitten icat \
--use-window-size "${kicat_wh_cells/x/,},${kicat_wh_pixels/x/,}" \
--place "${img_wh}@${img_tl}" \
--align left \
--transfer-mode=stream "$img_path"
```
error
```bash
Error: The --place option can only be used with a single image, not 2
```
Add --stdin=no
|
Beta Was this translation helpful? Give feedback.
-
On Wed, Mar 27, 2024 at 10:16:59PM -0700, iambumblehead wrote:
> Add --stdin=no
error is not seen after adding that, however image is no longer rendered --instead long text fills the screen
that will be because vifm is mangling the escape codes it gets from
icat before passing them to the tty. So stick to using the %N mode with /dev/tty.
|
Beta Was this translation helpful? Give feedback.
Then you should ask the vifm developers to pass through kitty graphics protoco escape codes since they do that for sixel escape codes already.