Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Bowery/prompt
/ functions
Functions
69 in github.com/Bowery/prompt
⨍
Functions
69
◇
Types & classes
14
↓ 25 callers
Method
String
String returns the data as a string.
buffer.go:31
↓ 14 callers
Method
Write
Write writes data from b into the input file.
ansi_unix.go:37
↓ 14 callers
Method
finish
finish finishes an ANSI escape code and calls the parsing function. Afterwards the escape buffer is emptied.
ansi_windows.go:501
↓ 12 callers
Method
longFunction
longFunction creates a long function code.
ansi_windows.go:221
↓ 10 callers
Method
Refresh
Refresh rewrites the prompt and buffer.
buffer_unix.go:12
↓ 6 callers
Method
EndLine
EndLine ends the line with CRLF.
buffer.go:136
↓ 5 callers
Method
Close
Close calls close on the internal terminal.
term.go:181
↓ 5 callers
Function
NewTerminal
NewTerminal creates a terminal and sets it to raw input mode.
term.go:59
↓ 4 callers
Method
Custom
Custom gets input and calls the given test function with the input to check if the input is valid, a true return will return the string.
term.go:124
↓ 4 callers
Method
arrow
arrow creates an arrow code.
ansi_windows.go:237
↓ 4 callers
Method
shortFunction
shortFunction creates a short function code.
ansi_windows.go:206
↓ 2 callers
Method
Basic
Basic gets input and if required tests to ensure input was given.
term.go:77
↓ 2 callers
Method
ClsScreen
ClsScreen clears the screen and refreshes.
buffer_unix.go:69
↓ 2 callers
Method
DelLeft
DelLeft removes the character to the left.
buffer.go:122
↓ 2 callers
Method
Insert
Insert inserts characters at the cursors position.
buffer.go:36
↓ 2 callers
Function
NewAnsiReader
NewAnsiReader creates a AnsiReader from the given input file.
ansi_unix.go:17
↓ 2 callers
Function
NewBuffer
NewBuffer creates a buffer writing to out if echo is true.
buffer.go:22
↓ 2 callers
Method
Password
Password retrieves a password from stdin without echoing it.
term.go:142
↓ 2 callers
Method
Read
Read reads data from the input file into b.
ansi_unix.go:22
↓ 2 callers
Method
Set
Set sets the content in the buffer.
buffer.go:59
↓ 2 callers
Method
delLine
delLine deletes the line the csbi cursor is positioned on. TODO: Possible refresh jittering reason, instead we should copy the Unix code and write ove
buffer_windows.go:110
↓ 2 callers
Method
mvLeftEdge
mvLeftEdge moves the cursor to the beginning of the line the csbi cursor is positioned on.
buffer_windows.go:126
↓ 2 callers
Function
newTerminal
newTerminal creates a terminal and sets it to raw input mode.
term_unix.go:42
↓ 2 callers
Method
read
read reads a rune and parses ANSI escape sequences found
term.go:235
↓ 2 callers
Function
setTermios
setTermios sets the termios settings for the terminal descriptor, optionally flushing the buffer before setting.
ioctl_unix.go:49
↓ 2 callers
Method
setup
setup initializes a prompt.
term.go:217
↓ 2 callers
Method
simplePrompt
simplePrompt is a fallback prompt without line editing support.
term.go:199
↓ 2 callers
Function
toBytes
toBytes converts a slice of runes to its equivalent in bytes.
buffer.go:142
↓ 1 callers
Method
Ask
Ask gets input and checks if it's truthy or not, and returns that in a boolean fashion.
term.go:100
↓ 1 callers
Method
BasicDefault
BasicDefault gets input and if empty uses the given default.
term.go:88
↓ 1 callers
Method
Del
Del removes the character at the cursor position.
buffer.go:109
↓ 1 callers
Method
End
End moves the cursor to the end.
buffer.go:79
↓ 1 callers
Method
GetPassword
GetPassword gets a line with the prefix and doesn't echo input.
term.go:169
↓ 1 callers
Method
GetPrompt
GetPrompt gets a line with the prefix and echos input.
term.go:157
↓ 1 callers
Function
IsNotTerminal
IsNotTerminal checks if an error is related to the input not being a terminal.
term.go:39
↓ 1 callers
Method
Left
Left moves the cursor one character left.
buffer.go:89
↓ 1 callers
Method
Refresh
Refresh rewrites the prompt and buffer.
buffer_windows.go:15
↓ 1 callers
Method
Right
Right moves the cursor one character right.
buffer.go:99
↓ 1 callers
Method
Start
Start moves the cursor to the start.
buffer.go:69
↓ 1 callers
Function
TerminalSize
TerminalSize retrieves the columns/rows for the terminal connected to out.
term.go:44
↓ 1 callers
Function
getTermios
getTermios retrieves the termios settings for the terminal descriptor.
ioctl_unix.go:35
↓ 1 callers
Function
isNotTerminal
isNotTerminal checks if an error is related to the input not being a terminal.
term_unix.go:30
↓ 1 callers
Method
mvToCol
mvTolCol moves the cursor to the col on the line the csbi cursor is positioned on.
buffer_windows.go:140
↓ 1 callers
Method
password
password reads from in and parses restricted ANSI escapes writing to buf.
term.go:458
↓ 1 callers
Method
prompt
prompt reads from in and parses ANSI escapes writing to buf.
term.go:336
↓ 1 callers
Function
supportsEditing
supportsEditing checks if the terminal supports ansi escapes.
term_unix.go:17
↓ 1 callers
Function
terminalSize
terminalSize retrieves the cols/rows for the terminal connected to out.
ioctl_unix.go:22
Function
Ask
Ask is a wrapper around Terminal.Ask.
prompt.go:55
Function
Basic
Basic is a wrapper around Terminal.Basic.
prompt.go:33
Function
BasicDefault
BasicDefault is a wrapper around Terminal.BasicDefault.
prompt.go:44
Method
Close
Close disables the terminals raw input.
term_unix.go:87
Method
Close
Close disables the terminals raw input.
term_windows.go:107
Method
ClsScreen
ClsScreen clears the screen and refreshes.
buffer_windows.go:78
Function
Custom
Custom is a wrapper around Terminal.Custom.
prompt.go:66
Function
ExampleBasic
()
example_test.go:19
Function
ExamplePassword
()
example_test.go:10
Function
NewAnsiReader
NewAnsiReader creates a AnsiReader from the given input file.
ansi_windows.go:46
Function
NewAnsiWriter
NewAnsiWriter creates a AnsiWriter from the given output file.
ansi_unix.go:32
Function
NewAnsiWriter
NewAnsiWriter creates a AnsiWriter from the given output.
ansi_windows.go:259
Function
Password
Password is a wrapper around Terminal.Password.
prompt.go:77
Method
Read
Read reads data from the input converting to ANSI escape codes that can be read over multiple Reads.
ansi_windows.go:52
Method
Reopen
Reopen re-opens an internal terminal.
term.go:186
Method
Write
Write writes the buffer filtering out ANSI escape codes and converting to the Windows functionality needed. ANSI escape codes may be found over multip
ansi_windows.go:266
Function
getTermios
getTermios retrieves the termios settings for the terminal descriptor.
ioctl_sysunix.go:30
Function
isNotTerminal
isNotTerminal checks if an error is related to the input not being a terminal.
term_windows.go:70
Function
newTerminal
newTerminal creates a terminal and sets it to raw input mode.
term_windows.go:84
Function
setTermios
setTermios sets the termios settings for the terminal descriptor, optionally flushing the buffer before setting.
ioctl_sysunix.go:36
Function
terminalSize
terminalSize retrieves the cols/rows for the terminal connected to out.
ioctl_sysunix.go:20
Function
terminalSize
terminalSize retrieves the cols/rows for the terminal connected to out.
term_windows.go:54