Skip to content

Commit 1ddb1e3

Browse files
authored
Fixes keyboard write when dashes are included (#124)
* use minus minus to stop option parsing * added changeset
1 parent 47df950 commit 1ddb1e3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.changeset/solid-ants-type.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@e2b/desktop-python': patch
3+
'@e2b/desktop': patch
4+
---
5+
6+
Uses minus minus in xdotool call to prevent parsing text as flag

packages/js-sdk/src/sandbox.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,9 @@ export class Sandbox extends SandboxBase {
509509

510510
for (const chunk of chunks) {
511511
await this.commands.run(
512-
`xdotool type --delay ${options.delayInMs} ${this.quoteString(chunk)}`
512+
`xdotool type --delay ${options.delayInMs} -- ${this.quoteString(
513+
chunk
514+
)}`
513515
)
514516
}
515517
}

packages/python-sdk/e2b_desktop/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def break_into_chunks(text: str, n: int):
543543

544544
for chunk in break_into_chunks(text, chunk_size):
545545
self.commands.run(
546-
f"xdotool type --delay {delay_in_ms} {quote_string(chunk)}"
546+
f"xdotool type --delay {delay_in_ms} -- {quote_string(chunk)}"
547547
)
548548

549549
def press(self, key: Union[str, list[str]]):

0 commit comments

Comments
 (0)