`devbox run -- cmd ARG`: a newline in ARG becomes a literal \n, and a quoted $ is expanded

オープン
#2,998 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
66/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
cli

調査の方向性

Start at the implementation of devbox run and trace how arguments after -- are passed to the command; the report suggests they may be joined and parsed as a shell string. Look for existing tests covering devbox run argument forwarding and run them first. Done means newline and dollar sign arguments, including quoted values, arrive unchanged.

索引モデルが issue の本文から書いたものです。

説明

Devbox 0.18.4, Linux (Ubuntu 24.04).

devbox run -- cmd ARG... does not pass the arguments through unchanged. It looks like the arguments are joined into one shell string and parsed again.

1. A newline in an argument becomes a literal \n.

devbox run -q -- node -e 'console.log(JSON.stringify(process.argv.slice(1)))' -- $'a\nb' "c d"

Expected: ["a\nb","c d"] (a real newline in the first argument)
Actual: ["a\\nb","c d"] (a backslash and an n)

Spaces survive, newlines do not. So a multi-line node -e or bash -c script does not parse under devbox run.

2. A $ in an argument is expanded, also when the caller quoted it.

devbox run -q -- printf '%s\n' 'a$HOME'
# expected: a$HOME
# actual:   a/home/<user>

devbox run -q -- bash -c 'X=inner; echo "[$X]"'
# expected: [inner]
# actual:   []

Workaround: write the script to a file and pass its path.

Expected behaviour: the arguments after -- reach the command exactly as the caller's shell gave them (as with exec "$@").

主要言語
Go
スター
12.4k
フォーク
358
平均マージ
17時間 12分
マージ済み PR(30日)
31

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jetify-com/devbox のほかの issue

jetify-com/devbox の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。