Skip to content

feat: positional remote command - #850

Merged
MisterTea merged 5 commits into
masterfrom
feat/positional-command
Sep 23, 2026
Merged

MisterTea merged 5 commits into
masterfrom
feat/positional-command

Conversation

@MisterTea

@MisterTea MisterTea commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • et [options] user@host command... runs that command, the same shape as ssh.
  • -c still supplies the command when no positional command is present.
  • A -- before the host ends client options, and the next token is the host.

Test plan

  • ClientArgParsing unit tests (42 assertions): positional command, -c alone, dash operands after the host, --option=value, and -- before the host
  • ctest --test-dir build --output-on-failure --parallel

Cursor passes the remote command as operands after the host, not only as -c.

Co-authored-by: Cursor <cursoragent@cursor.com>
@codecov

codecov Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.53439% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.41%. Comparing base (34b1948) to head (3a10be0).

Files with missing lines Patch % Lines
src/terminal/ClientArgParsing.hpp 78.08% 10 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #850      +/-   ##
==========================================
+ Coverage   79.28%   79.41%   +0.13%     
==========================================
  Files         125      127       +2     
  Lines       13090    13279     +189     
  Branches     8441     8572     +131     
==========================================
+ Hits        10378    10546     +168     
- Misses       1613     1626      +13     
- Partials     1099     1107       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Command operands are parsed incorrectly after the host, and a required standard header is missing.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds SSH-style positional remote commands while preserving -c fallback behavior.

Changes:

  • Adds positional command and destination parsing helpers.
  • Integrates command parsing and adds unit tests.
  • Makes SSH configuration helpers inline.
File Description
test/​unit_tests/​ClientArgParsingTest.cpp Tests positional commands and -c behavior.
src/​terminal/​TerminalClientMain.cpp Integrates positional commands, but option-like command operands are incorrectly parsed as client options.
src/​terminal/​ParseConfigFile.hpp Makes header-defined helpers inline.
src/​terminal/​ClientArgParsing.hpp Adds parsing helpers but lacks the required <stdexcept> include.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/terminal/TerminalClientMain.cpp Outdated
cxxopts::value<std::vector<std::string>>());

options.parse_positional({"host"});
options.parse_positional({"host", "command_args"});
jasongauci-webai and others added 4 commits September 23, 2026 11:20
cxxopts was still parsing options after the destination, so ssh-style
commands like `echo -n` and `sh -c` lost those words.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
The compatibility client passes --serverfifo=/tmp/... before
localhost:port. That equals form was treated as the destination, so et
exited with "Missing host".

Co-authored-by: Cursor <cursoragent@cursor.com>
ssh-style `et -- host command` was treating the host as a remote operand.

Co-authored-by: Cursor <cursoragent@cursor.com>
@MisterTea
MisterTea merged commit 7a0fe09 into master Sep 23, 2026
37 checks passed
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.

3 participants