File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,10 +7,7 @@ import (
77 "io"
88 "os"
99 "os/signal"
10- "regexp"
1110 "strings"
12-
13- "github.com/acarl005/stripansi"
1411)
1512
1613func main () {
@@ -31,7 +28,7 @@ func main() {
3128 fmt .Fprintf (os .Stderr , "failed to open cast file: %v\n " , err )
3229 os .Exit (1 )
3330 }
34- defer f .Close ()
31+ defer func () { _ = f .Close () } ()
3532
3633 stdinReader := bufio .NewReader (os .Stdin )
3734 fileScanner := bufio .NewScanner (f )
@@ -105,19 +102,3 @@ func main() {
105102 // Block until interrupted.
106103 <- make (chan struct {})
107104}
108-
109- func cleanTerminalInput (input string ) string {
110- input = stripansi .Strip (input )
111-
112- bracketedPasteRe := regexp .MustCompile (`\x1b\[\d+~` )
113- input = bracketedPasteRe .ReplaceAllString (input , "" )
114-
115- backspaceRe := regexp .MustCompile (`.\x08` )
116- input = backspaceRe .ReplaceAllString (input , "" )
117-
118- input = strings .ReplaceAll (input , "\x08 " , "" )
119- input = strings .ReplaceAll (input , "\x7f " , "" )
120- input = strings .ReplaceAll (input , "\x1b " , "" )
121-
122- return strings .TrimSpace (input )
123- }
You can’t perform that action at this time.
0 commit comments