Reader Settings
In case you want to set things up
The reader currently has a global settings instance session-wide. However, it can get overridden if you make a new instance of TermReaderSettings with some available properties mentioned below set. They get read each time you call this function or you activate a keybinding that uses one of these settings.
Here are the available settings that you can set:
PasswordMaskCharSets the password masking character.
HistoryEnabledWhether the history is enabled or not.
HistoryNameSelect what history to use
LeftMarginSets the left margin of the input.
RightMarginSets the right margin of the input.
InputForegroundColorThe foreground color for the input text, as well as the input prompt.
InputBackgroundColorThe background color for the input text, as well as the input prompt.
SuggestionsSets a function that you could use to return an array of strings containing auto completion data.
SuggestionsDelimitersDelimiters to split the current input within a function that returns a list of suggestions.
TreatCtrlCAsInputWhether to treat
Ctrl+Cas input or not. If enabled, TermRead will process this keybinding as aborting the current input.
PlaceholderTextThis is the text that the terminal reader shows when there is no input text. This is used to give users hints on what they should write to the prompt.
PrintDefaultValueWhether to print the default value or not. Disables
WriteDefaultValue.
WriteDefaultValueWhether to make the default value part of the input or not. Disables
PrintDefaultValue.
InitialPositionWhere to set the initial cursor position for the reader (only works when there is a default value and
WriteDefaultValueis on)
DefaultValueFormatThe default value format to print if
PrintDefaultValueis enabled and there is a prompt.
KeyboardCuesWhether to play keyboard cues for each keypress
BassBoomLibraryPathIn case of addons or other custom path for MPG123, specifies a root path to BassBoom's libraries. See here for more info.
PlayWriteCueSpecifies whether to play a write cue (that is, plays a sound for each keypress). You can specify your custom write cue using the
CueWriteproperty, but be sure to pass it a stream that contains an MP3 file content that BassBoom can play.
PlayRuboutCueSpecifies whether to play a rubout cue (that is, plays a sound for every backspace press). You can specify your custom write cue using the
CueRuboutproperty, but be sure to pass it a stream that contains an MP3 file content that BassBoom can play.
PlayEnterCueSpecifies whether to play an enter cue (that is, plays a sound for each "submit" key, such as Enter). You can specify your custom write cue using the
CueEnterproperty, but be sure to pass it a stream that contains an MP3 file content that BassBoom can play.
CueVolumeSpecifies the cue volume in fractional number between
0.0and1.0(or3.0with volume boost)
CueVolumeBoostAllows the cue volume to go above
1.0to the maximum of3.0.
BellSpecifies how to launch a console bell (audible for beep sounds, visual for flashing console, or none for nothing)