Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Make TTY raw-mode changes fallible and restore terminal state

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust

調査の方向性

src/lib.rs:1999-2007 の TTY ホスト関数と platform/Tty.roc:13-18 の公開型から始め、次に src/lib.rs:2112-2124 の roc_main 呼び出しを調べます。raw モード操作を繰り返した場合の所有権とエラー動作を定義し、PTY 統合テストを使って、通常のリターン、アプリケーションエラー、およびサポートされている Roc の crash/expect パスの後に復元されることを検証します。

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

説明

bug

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_main for 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

環境構築

はじめの一歩

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

roc-lang/basic-cli のほかの issue

roc-lang/basic-cli の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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