mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-19 01:51:21 +08:00
Merge pull request #6573 from Kilo-Org/fix/issue-6559-copy-shell-command-dollar-sign
This commit is contained in:
@@ -1430,16 +1430,17 @@ ToolRegistry.register({
|
||||
name: "bash",
|
||||
render(props) {
|
||||
const i18n = useI18n()
|
||||
const text = createMemo(() => {
|
||||
const cmd = props.input.command ?? props.metadata.command ?? ""
|
||||
const out = stripAnsi(props.output || props.metadata.output || "")
|
||||
return `$ ${cmd}${out ? "\n\n" + out : ""}`
|
||||
})
|
||||
// kilocode_change start - separate cmd/output memos so copy excludes the "$ " display prefix
|
||||
const cmd = createMemo(() => props.input.command ?? props.metadata.command ?? "")
|
||||
const out = createMemo(() => stripAnsi(props.output || props.metadata.output || ""))
|
||||
const text = createMemo(() => `$ ${cmd()}${out() ? "\n\n" + out() : ""}`)
|
||||
// kilocode_change end
|
||||
const [copied, setCopied] = createSignal(false)
|
||||
|
||||
const handleCopy = async () => {
|
||||
const content = text()
|
||||
if (!content) return
|
||||
const command = cmd() // kilocode_change
|
||||
if (!command) return
|
||||
const content = out() ? `${command}\n\n${out()}` : command // kilocode_change
|
||||
await navigator.clipboard.writeText(content)
|
||||
setCopied(true)
|
||||
setTimeout(() => setCopied(false), 2000)
|
||||
|
||||
Reference in New Issue
Block a user