Question: How pty behaives with empty command.
还没有人认领这个 Issue。
评估
- 难度
- 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 分钟
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rust-cli/rexpect 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 38/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 2/5 1-3 小时 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 48/100
-
难度 3/5 1-2 天 新手友好度 25/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
state:needs triage
难度 2/5 1-3 小时 新手友好度 70/100
zed-industries/zed#64680 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 70/100
RustPython/RustPython#8802 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
TheLarkInn/aipm#2390 ·