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

Question: How pty behaives with empty command.

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
15/100
issue の種類
ドキュメント
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
rust

調査の方向性

まず test_no_cmd 関数と PtyProcess::new(Command::new("")) の呼び出しから始め、その後、repository の pty/tty 処理とターミナルのエコー動作を調べてください。空のコマンドの影響を含め、エコーされた文字列が表示される理由を明確に説明できれば完了です。

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

説明

I was tinkering pty/tty stuff and still not clearly understand how it works :). And you're @philippkeller the most right person who I could address this question. Example below.

Currently this test will pass.
But why?

Why we get this echoed strings?

I've tested the flags.local_flags &= !termios::LocalFlags::ECHO works fine.

Thanks in advance.


    #[test]
    /// Open cat, write string, read back string twice, send Ctrl^C and check that cat exited
    fn test_no_cmd() {
        // wrapping into closure so I can use ?
        || -> std::io::Result<()> {
            let process = PtyProcess::new(Command::new("")).expect("could not execute cat");
            let f = process.get_file_handle();
            let mut writer = LineWriter::new(&f);
            let mut reader = BufReader::new(&f);
            writer.write_all(b"hello cat\n")?;
            let mut buf = String::new();
            reader.read_line(&mut buf)?;
            assert_eq!(buf, "hello cat\r\n");

            Ok(())
        }()
        .unwrap_or_else(|e| panic!("test_cat failed: {}", e));
    }
主要言語
Rust
スター
391
フォーク
69
平均マージ
1日 34分
マージ済み PR(30日)
2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

rust-cli/rexpect のほかの issue

rust-cli/rexpect の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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