Cannot backspace during interactive stdin
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 906
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
Hi, thanks for all your hard work on gow! It is an amazingly simple tool and it has saved me so many development hours during the time that I've used it.
I have an issue where my program has an interactive flow where it prompts the user for input at certain points, and I'm trying to run this flow using gow when doing manual testing.
Everything works perfectly, except while inputting text I cannot backspace. See video:
https://github.com/mitranim/gow/assets/438911/56bcdbfb-a14f-44f0-82be-bbaa9b79cfdd
I'm on macOS 13.5 and have tried this in iTerm and Terminal.app. As seen in the video it's not just visual, the text ultimately entered has whitespace added onto it instead of characters removed from it. Is this intentional?
Thanks for any help!
EDIT: For convenience, here's the code used in the screen recording:
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
fmt.Print("Enter some text: ")
in := bufio.NewReader(os.Stdin)
line, err := in.ReadString('\n')
if err != nil {
panic(fmt.Errorf("cannot read input: %w", err))
}
fmt.Println("You inputted:", line)
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the provided Go program run through gow, using a terminal where backspace works normally. Then trace how gow forwards interactive stdin and terminal input. Done means backspace visibly removes characters and the resulting line contains no whitespace for deleted characters.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100