Skip to content

Bug: Terminal - Kitty socket invalid due to a launch race condition #692

@Fredzer

Description

@Fredzer

Hey
I've run into a consistent issue with the Kitty terminal integration on desktop. The problem looks to be a race condition on the launch.

XPipe launches kitty --detach but attempts to use the communication socket with socat almost immediately.
Leaving not enough time for the socket to be created and causing socat to write a regular file instead, which breaks the connection.

This broken file then causes all subsequent launches (for simple shells or Zellij to fail with an Invalid listen_on

Errors parsing configuration
In final effective configuration:
Invalid listen_on=unix:/tmp/xpipe/fredzer/xpipe_kitty, ignoring
Press Enter or Esc to exit
$ ls -ld /tmp/xpipe/fredzer/xpipe_kitty 

Socket file

Invalid State -
-rw-r--r-- 1 /tmp/xpipe/fredzer/xpipe_kitty

Good State -
srwxr-xr-x 1 /tmp/xpipe/fredzer/xpipe_kitty

Environment:

  • XPipe Version: 18.7/2025-09-17-05-52
  • Operating System: EndeavourOS (Arch Linux)
  • Hardware: Intel i9-10900K, NVMe Storage

Logs:
The logs show socat is called less than 200ms after kitty is launched, which triggers the race condition.
From the log + debug output steps- I've ran the commands manually (human speed) and kitty socket is created > open new kitty connection and connect just fine, so it does the job but its then tripping its self up.

Source Code:
This seems to be caused by the timing heuristic in KittyTerminalType.java

var elapsed = System.currentTimeMillis() - time;
// Good heuristic on how long to wait
ThreadHelper.sleep(5 * elapsed);

I've patched with timer wrappers for a while but wanted to raise it here as I haven't seen any similar issues logged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions