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

Shell prints input line when run with NewWithConfig on different terminal

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go
領域
cli

調査の方向性

ishell.go の NewWithConfig 関数と、readline.Config との連携方法を調べてください。この問題は、StdinWriter フィールドによって二重にエコーされることが原因である可能性があります。カスタムターミナルで設定した場合に readline ライブラリが入力/出力ストリームをどのように処理するかを調べてください。config を変更して netcat 経由で接続し、重複が停止するか確認してテストしてください。

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

説明

Apols if I'm making a mistake here and this is not a bug - I would like to be able to access ishell through another terminal instance on Linux with go 1.12.5. So first, I set up a listener (leaving out error handling and defer here to keep the code short):

 listener, err := net.Listen("tcp", host)
 conn, err := listener.Accept()

where host is "localhost:8000" for testing. Next, I've imported "github.com/abiosoft/readline" to be able to run the shell with the listener's connection parameters in the configuration for NewWithConfig:

termCfg := &readline.Config{
        Stdin:       io.ReadCloser(conn),
        Stdout:      io.Writer(conn),
        StdinWriter: io.Writer(conn),
        Stderr:      io.Writer(conn),
}

Then I start the shell in a second terminal window through the listener:

shell := ishell.NewWithConfig(termCfg)
shell.Run()

This works fine when I open another shell and connect with nc localhost 8000 - except for the fact that after I type in a command such as help, the input line is not only echoed character for character as expected, but then printed again, giving me stuff like

> help
> help

Commands:
  clear        clear the screen
  exit         exit the program
  help         display help

I'm wondering if StdinWriter is the problem here, but changing that doesn't seem to help. I can't find an example for NewWithConfig in the docs. Is this a bug or am I missing something obvious? Thanks!

主要言語
Go
スター
1.8k
フォーク
213
PR マージ指標
30日以内にマージされた PR はありません

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

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

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

abiosoft/ishell のほかの issue

abiosoft/ishell の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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