Skip to content

fix(files,terminal): one path and shell-syntax contract on every OS - #146

Merged
M09Ic merged 2 commits into
masterfrom
fix/runner-path-shell-syntax
Sep 22, 2026
Merged

M09Ic merged 2 commits into
masterfrom
fix/runner-path-shell-syntax

Conversation

@M09Ic

@M09Ic M09Ic commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • File tools accept either separator, clean . and duplicates, and keep a single / namespace. path.Match treats \ as an escape on every OS, and os.Root wants slash paths.
  • Shell scripts are parsed before argv splitting. A literal registered command stays in-process, including quoted empty arguments. Composition runs through a real shell instead of guessing operators from the raw string.
  • On Windows the shell is a Win32 bash (Git or MSYS) when one is installed, and cmd.exe only when it is not. Output goes through a pipe in a kill-on-close job, so the console cannot rewrite newlines or trailing spaces and cancel still stops MSYS children that leave the process tree.
  • Supersedes fix(commands): route bash scripts using shell syntax #136. The parser and its tests are ported onto the current terminal tool; that branch is not merged on its own.

Absolute workdir joining for a remote runner stays in Cairn. The server is not the runner's OS.

Test plan

  • Windows: go test -count=1 ./tools/terminal/ ./tools/files/ ./core/tool/ ./pkg/exts/files/ ./pkg/exts/prompt/
  • WSL Ubuntu, same packages
  • memory_echo one&&memory_echo two runs both; 'a;b' and a quoted empty argument stay arguments
  • Cancel during sleep does not run the rest of the line

Local file paths now collapse either separator to a slash path before
os.Root and path.Match, so a Windows separator is not an escape. Bash
detects operators before tokenization instead of dropping them. Virtual
mounts can sit on a path prefix such as cyber://skills/.
Parse the script instead of guessing operators from argv. Windows uses
a Win32 bash when one is installed, and a pipe in a kill-on-close job
so the console cannot rewrite output and cancel still stops MSYS children.
@M09Ic
M09Ic merged commit 540ee09 into master Sep 22, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant