Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#2203·kanata

Suspected timing issue with clipboard-cmd-set and its variants in macro

Author: shuangsystemCreated Sep 30, 2026Updated Sep 30, 2026
Labelsbug

Requirements

  • I've searched platform-specific issues, issues and discussions to see if this has been reported before.
  • My issue does not involve multiple simultaneous key presses, OR it does but I've confirmed it is not key rollover or ghosting.

Describe the bug

lisp
(defcfg
  process-unmapped-keys yes
  danger-enable-cmd yes
)

(defsrc)

(deflayermap (main)
  caps (tap-hold-press 0 180 caps (layer-while-held test))
)

(defvar time 100)

(deflayermap (test)
  r (macro
    (clipboard-cmd-set bash -c "sleep 5; echo abc")
    C-v
    $time
    (clipboard-set "")
    (clipboard-restore 100)
  )
  t (macro
    (clipboard-cmd-set bash -c "sleep 5; echo abc")
    C-v          
    $time
  )
)

When I use the above configuration, triggering r hangs for 5 seconds and then outputs nothing.
Triggering t hangs for 5 seconds and then outputs abc.
In fact, when $time is less than the blocking time, this situation occurs. Otherwise, it outputs abc. This is clearly counterintuitive. 当我使用以上配置, 触发r会卡住5秒, 然后什么都不输出 而触发t会卡住5秒, 然后输出abc 事实上, 当$time小于阻塞的时间时, 这样的情况就会发生. 反之, 则会输出abc, 这明显是违反常识的

Relevant kanata config

See the config in the description.

To Reproduce

.

Expected behavior

.

Kanata version

v1.12.1-prerelease-1

Debug logs

N/A

Operating system and I/O mechanism

Arch Linux, evdev

Additional context

No response

Source: jtroo/kanata

View original on GitHubView discussion on GitHub