Skip to content

Commit 0c59ffa

Browse files
committed
Fix: status check doesn't work on bg command if something is running in front
1 parent 83ae401 commit 0c59ffa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
authors = [{ name = "Aman Rusia", email = "[email protected]" }]
33
name = "wcgw"
4-
version = "5.5.3"
4+
version = "5.5.4"
55
description = "Shell and coding agent for Claude and other mcp clients"
66
readme = "README.md"
77
requires-python = ">=3.11"

src/wcgw/client/bash_state/bash_state.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,11 +1060,11 @@ def deserialize(cls, data: dict[str, Any]) -> "FileWhitelistData":
10601060
)
10611061

10621062

1063-
WAITING_INPUT_MESSAGE = """A command is already running. NOTE: You can't run multiple shell sessions, likely a previous program hasn't exited.
1063+
WAITING_INPUT_MESSAGE = """A command is already running. NOTE: You can't run multiple shell commands in main shell, likely a previous program hasn't exited.
10641064
1. Get its output using status check.
10651065
2. Use `send_ascii` or `send_specials` to give inputs to the running program OR
10661066
3. kill the previous program by sending ctrl+c first using `send_ascii` or `send_specials`
1067-
4. Interrupt and run the process in background by re-running it using screen
1067+
4. Interrupt and run the process in background
10681068
"""
10691069

10701070

@@ -1250,9 +1250,6 @@ def _execute_bash(
12501250

12511251
bash_state.console.print(f"$ {command_data.command}")
12521252

1253-
if bash_state.state == "pending":
1254-
raise ValueError(WAITING_INPUT_MESSAGE)
1255-
12561253
command = command_data.command.strip()
12571254

12581255
assert_single_statement(command)
@@ -1261,6 +1258,9 @@ def _execute_bash(
12611258
bash_state = bash_state.start_new_bg_shell(bash_state.cwd)
12621259
is_bg = True
12631260

1261+
if bash_state.state == "pending":
1262+
raise ValueError(WAITING_INPUT_MESSAGE)
1263+
12641264
bash_state.clear_to_run()
12651265
for i in range(0, len(command), 64):
12661266
bash_state.send(command[i : i + 64], set_as_command=None)

0 commit comments

Comments
 (0)