-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to ergochat/readline, enable readline by default (#41)
* switch to ergochat/readline, enable readline by default * don't shadow the console library * bump readline to v0.0.3 * bump readline temporarily to 2f9fbc2eecc78 * fetch the new readline tag
- Loading branch information
Showing
159 changed files
with
12,980 additions
and
4,261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
// Copyright (c) 2023 Shivaram Lingamneni <[email protected]> | ||
// released under the ISC license | ||
|
||
package lib | ||
package console | ||
|
||
import ( | ||
"io" | ||
"os" | ||
|
||
"github.com/ergochat/irc-go/ircreader" | ||
|
||
"github.com/ergochat/ircdog/lib" | ||
) | ||
|
||
// Console is an abstract representation of keyboard input and screen output | ||
|
@@ -26,7 +28,7 @@ type stdioConsole struct { | |
|
||
func NewStandardConsole() (Console, error) { | ||
result := new(stdioConsole) | ||
result.reader.Initialize(os.Stdin, InitialBufferSize, MaxBufferSize) | ||
result.reader.Initialize(os.Stdin, lib.InitialBufferSize, lib.MaxBufferSize) | ||
return result, nil | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//go:build minimal | ||
|
||
package console | ||
|
||
func NewConsole(enableReadline bool, historyFile string) (Console, error) { | ||
return NewStandardConsole() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//go:build !minimal | ||
|
||
package console | ||
|
||
import ( | ||
"syscall" | ||
|
||
"github.com/ergochat/readline" | ||
"golang.org/x/term" | ||
) | ||
|
||
func NewConsole(enableReadline bool, historyFile string) (Console, error) { | ||
if !(enableReadline && term.IsTerminal(int(syscall.Stdin))) { | ||
return NewStandardConsole() | ||
} | ||
return readline.NewFromConfig(&readline.Config{ | ||
Prompt: ">>> ", | ||
HistoryFile: historyFile, | ||
HistoryLimit: 1000, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= | ||
github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= | ||
github.com/docopt/docopt-go v0.0.0-20160216232012-784ddc588536 h1:rHnpq7uNlix5l7tWZ55iJcHHrxCPnOVF4FGb7qOT2Jc= | ||
github.com/docopt/docopt-go v0.0.0-20160216232012-784ddc588536/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= | ||
github.com/ergochat/irc-go v0.3.0 h1:qgvb2knh8d6yIVsHX+PRQ2CiRj1NGG5x88ABmR1lWng= | ||
github.com/ergochat/irc-go v0.3.0/go.mod h1:2vi7KNpIPWnReB5hmLpl92eMywQvuIeIIGdt/FQCph0= | ||
github.com/ergochat/readline v0.0.2 h1:AlCbi98PNX4fxvduMrEbf72jRjHCTnFCSOpx4OhJnGE= | ||
github.com/ergochat/readline v0.0.2/go.mod h1:9g3OwkSE7gXLVkbd1LpZS/tuOCtO3oGezyxp/fJwUx8= | ||
github.com/ergochat/readline v0.0.3 h1:PYU6ItEq7JW4QLZmR8y4f2kGqWUyJtQdrucK4c/C9wg= | ||
github.com/ergochat/readline v0.0.3/go.mod h1:9g3OwkSE7gXLVkbd1LpZS/tuOCtO3oGezyxp/fJwUx8= | ||
github.com/ergochat/readline v0.0.4 h1:NvLFqh4iBaGZNu9J1hZHQnme/WKH8Jiew+u3CwA/Igw= | ||
github.com/ergochat/readline v0.0.4/go.mod h1:9g3OwkSE7gXLVkbd1LpZS/tuOCtO3oGezyxp/fJwUx8= | ||
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= | ||
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= | ||
github.com/jwalton/go-supportscolor v1.1.0 h1:HsXFJdMPjRUAx8cIW6g30hVSFYaxh9yRQwEWgkAR7lQ= | ||
github.com/jwalton/go-supportscolor v1.1.0/go.mod h1:hFVUAZV2cWg+WFFC4v8pT2X/S2qUUBYMioBD9AINXGs= | ||
github.com/slingamn/readline v0.0.0-20230227035143-99fd32183842 h1:dZinPfCSSyz4UhEHJbftBTMShexVSP9ecKfoahYHr/o= | ||
github.com/slingamn/readline v0.0.0-20230227035143-99fd32183842/go.mod h1:6vWnQ7ytBpt1mO7e1J5f0U5Dr9uGRUFMMQn6K/VOVis= | ||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= | ||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= | ||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= | ||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= | ||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= | ||
golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= | ||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= | ||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= | ||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.