Skip to content

Commit 93671bb

Browse files
authored
Merge pull request #7 from rusiaaman/feat/bashrc
Using bashrc by default
2 parents c228682 + aed9d7e commit 93671bb

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

Diff for: pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[project]
22
authors = [{ name = "Aman Rusia", email = "[email protected]" }]
33
name = "wcgw"
4-
version = "2.0.3"
5-
description = "What could go wrong giving full shell access to chatgpt?"
4+
version = "2.0.4"
5+
description = "Shell and coding agent on claude and chatgpt"
66
readme = "README.md"
77
requires-python = ">=3.11, <3.13"
88
dependencies = [

Diff for: src/wcgw/client/tools.py

+21-7
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,27 @@ def ask_confirmation(prompt: Confirmation) -> str:
106106

107107

108108
def start_shell() -> pexpect.spawn: # type: ignore
109-
SHELL = pexpect.spawn(
110-
"/bin/bash --noprofile --norc",
111-
env={**os.environ, **{"PS1": PROMPT}}, # type: ignore[arg-type]
112-
echo=False,
113-
encoding="utf-8",
114-
timeout=TIMEOUT,
115-
)
109+
try:
110+
SHELL = pexpect.spawn(
111+
"/bin/bash",
112+
env={**os.environ, **{"PS1": PROMPT}}, # type: ignore[arg-type]
113+
echo=False,
114+
encoding="utf-8",
115+
timeout=TIMEOUT,
116+
)
117+
SHELL.sendline(f"export PS1={PROMPT}")
118+
except Exception as e:
119+
traceback.print_exc()
120+
console.log(f"Error starting shell: {e}. Retrying without rc ...")
121+
122+
SHELL = pexpect.spawn(
123+
"/bin/bash --noprofile --norc",
124+
env={**os.environ, **{"PS1": PROMPT}}, # type: ignore[arg-type]
125+
echo=False,
126+
encoding="utf-8",
127+
timeout=TIMEOUT,
128+
)
129+
116130
SHELL.expect(PROMPT, timeout=TIMEOUT)
117131
SHELL.sendline("stty -icanon -echo")
118132
SHELL.expect(PROMPT, timeout=TIMEOUT)

Diff for: uv.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)