Make TTY raw-mode changes fallible and restore terminal state
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust
- 領域
- cli, operating-systems
調査の方向性
src/lib.rs:1999-2007 の TTY ホスト関数と platform/Tty.roc:13-18 の公開型から始め、次に src/lib.rs:2112-2124 の roc_main 呼び出しを調べます。raw モード操作を繰り返した場合の所有権とエラー動作を定義し、PTY 統合テストを使って、通常のリターン、アプリケーションエラー、およびサポートされている Roc の crash/expect パスの後に復元されることを検証します。
索引モデルが issue の本文から書いたものです。
説明
Context
Both TTY host functions discard the result returned by crossterm:
src/lib.rs:1999-2007
The public functions are therefore typed as infallible in platform/Tty.roc:13-18, even when stdin is not a terminal or the OS rejects the operation.
The host also does not visibly track whether it enabled raw mode or guarantee restoration when the Roc application returns an error or crashes. #69 previously tracked panic restoration and was closed, but the current implementation still ignores errors and calls roc_main without a raw-mode cleanup guard at src/lib.rs:2112-2124.
Suggested direction
- Return a typed error from enable/disable operations.
- Track raw-mode ownership so the host only restores a mode it enabled.
- Install cleanup around
roc_mainfor normal return and Roc crash/expect paths. - Document what can and cannot be guaranteed for external termination signals.
A small RAII guard in the Rust host may make the normal and unwinding paths easier to reason about, although the release profile uses panic = "abort" and therefore also needs explicit crash-handler consideration.
Acceptance criteria
- Enabling or disabling raw mode reports OS errors to Roc.
- Raw mode is restored after normal success and application-level error returns.
- Raw mode restoration is tested for the Roc crash/expect path supported by the host.
- Repeated enable/disable calls have defined behavior.
- PTY integration tests verify the terminal state after the child exits.
- 主要言語
- Rust
- スター
- 121
- フォーク
- 46
- 平均マージ
- 19時間 1分
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
roc-lang/basic-cli のほかの issue
-
Unix socket supportオープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
roc-lang/basic-cli#455 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
roc-lang/basic-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
install: root SSH tmpfiles.d drop-in is labeled etc_runtime_t instead of etc_t対応中かも @andrewdunndev が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
[Misdetection] `text/tab-separated-values` file misdetected as `text/tsv`対応中かも @bact が今日担当しました。 オープンmisdetection needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
C-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信