Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

Using Claude Code causes bugs when copying and pasting.

Open Sado4 opened this issue 11 months ago • 2 comments

Before opening, please confirm:

Operating System

macOS 15.7.3

Kiro Version

1.23.0

Bug Description

Using Claude Code causes bugs when copying and pasting.

Steps to Reproduce

When I copy and paste a long text into the Claude Code terminal, I get the following error:

thread 'kiro-cli-term-runtime-worker-5' panicked at crates/figterm/src/input/mod.rs:1774:56:
range end index 44303 out of range for slice of length 44295
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected Behavior

Not causing an error

Conversation ID

No response

Additional Context

No response

Sado4 avatar Dec 21 '25 02:12 Sado4

I’m hitting the same crash on my side:

thread 'kiro-cli-term-runtime-worker-4' panicked at crates/figterm/src/input/mod.rs:1774:56:
range end index 1204 out of range for slice of length 1203

shutootaki avatar Dec 30 '25 08:12 shutootaki

Temporary workaround (confirmed working): disable the figterm shell integration

The panic is thrown by the figterm runtime worker (kiro-cli-term-runtime-worker), which wraps your shell. If you stop the shell integration from loading, the figterm process never spawns, so the paste-buffer slice panic can't be hit. You keep kiro-cli itself — you only lose the inline terminal integration (autocomplete / ghost text). For people running Claude Code (or any other TUI) inside the kiro terminal, that's a fine trade until this is fixed.

The integration is injected by two kiro-cli init <shell> pre|post lines in your shell startup. Comment out both, then open a new terminal.

fish (~/.config/fish/conf.d/):

# 00_fig_pre.fish
# test -x ~/.local/bin/kiro-cli; and eval (~/.local/bin/kiro-cli init fish pre  --rcfile 00_fig_pre  | string split0)

# 99_fig_post.fish
# test -x ~/.local/bin/kiro-cli; and eval (~/.local/bin/kiro-cli init fish post --rcfile 99_fig_post | string split0)

bash/zsh have the equivalent kiro-cli init bash|zsh pre|post lines in the generated rc files (~/.bashrc / ~/.zshrc or the kiro-managed snippets) — comment those two out the same way.

Reverting is just removing the leading # and opening a new terminal.

Trigger confirmed on my side: pasting long text into the Claude Code TUI. The off-by-one (range end index N out of range for slice of length N-k) is in figterm's input slicing at crates/figterm/src/input/mod.rs:1774, so taking figterm out of the path avoids it entirely until the upstream slice bug is fixed.

Tested on kiro-cli 2.7.0 / macOS / fish.

renanlido avatar Jun 14 '26 23:06 renanlido