Standard fenrir backgrounding and -d flags restored.
This commit is contained in:
1 parent
4f5a875d0e
commit
eaf450587c
13 files changed
+408
-20
No files matched your search
+10
-4
@@ -53,15 +53,21 @@ func (disabledVoice) Errors() <-chan error { return nil }
|
||||
func (disabledVoice) Close() {}
|
||||
|
||||
func Start(ctx context.Context, settings config.Settings, configPath string, bindings []input.Binding) error {
|
||||
return start(ctx, settings, false, configPath, bindings)
|
||||
return Start_with_ready(ctx, settings, configPath, bindings, nil)
|
||||
}
|
||||
|
||||
// Start_with_ready reports console startup after the first screen and input poll.
|
||||
// A failed notification tears down the reader and releases its keyboards.
|
||||
func Start_with_ready(ctx context.Context, settings config.Settings, configPath string, bindings []input.Binding, ready func() error) error {
|
||||
return start(ctx, settings, false, configPath, bindings, ready)
|
||||
}
|
||||
|
||||
// Start_terminal runs the same reader and command dispatcher in an X11 PTY.
|
||||
func Start_terminal(ctx context.Context, settings config.Settings, configPath string, bindings []input.Binding) error {
|
||||
return start(ctx, settings, true, configPath, bindings)
|
||||
return start(ctx, settings, true, configPath, bindings, nil)
|
||||
}
|
||||
|
||||
func start(ctx context.Context, settings config.Settings, terminalMode bool, configPath string, bindings []input.Binding) (result error) {
|
||||
func start(ctx context.Context, settings config.Settings, terminalMode bool, configPath string, bindings []input.Binding, ready func() error) (result error) {
|
||||
if err := settings.Validate(); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -168,7 +174,7 @@ func start(ctx context.Context, settings config.Settings, terminalMode bool, con
|
||||
}
|
||||
transfers := clipboard.New_worker(ctx, paste)
|
||||
defer transfers.Close()
|
||||
result = Run(ctx, source, keyboards, voices, RunOptions{Spellcheck: spellChecker, Bindings: bindings, Settings: settings, EffectiveSpeech: effectiveSpeech, Punctuation: punctuationProcessor, Sounds: cues, ConfigPath: configPath, Clipboard: transfers, ClipboardHistory: historyStore, SettingsChoices: preferences.Discover_choices, Scripts: scriptCommands, ScriptRunner: scriptRunner, Remote: remote, TerminalMode: terminalMode})
|
||||
result = Run(ctx, source, keyboards, voices, RunOptions{Ready: ready, Spellcheck: spellChecker, Bindings: bindings, Settings: settings, EffectiveSpeech: effectiveSpeech, Punctuation: punctuationProcessor, Sounds: cues, ConfigPath: configPath, Clipboard: transfers, ClipboardHistory: historyStore, SettingsChoices: preferences.Discover_choices, Scripts: scriptCommands, ScriptRunner: scriptRunner, Remote: remote, TerminalMode: terminalMode})
|
||||
if result == nil && player != nil {
|
||||
if err := player.Finish(context.Background()); err != nil {
|
||||
slog.Warn("shutdown sound incomplete", "error", err, "at", time.Now())
|
||||
|
||||
Reference in new issue
Block a user