This commit is contained in:
SamareshSingh 2026-04-23 01:51:15 -05:00 committed by GitHub
commit c1566781d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2041,6 +2041,11 @@ func launchInteractiveModel(cmd *cobra.Command, modelName string) error {
// runInteractiveTUI runs the main interactive TUI menu.
func runInteractiveTUI(cmd *cobra.Command) {
if !term.IsTerminal(int(os.Stdin.Fd())) || !term.IsTerminal(int(os.Stdout.Fd())) {
fmt.Fprintln(os.Stderr, "Error: interactive terminal required. To start the server, run: ollama serve")
return
}
// Ensure the server is running before showing the TUI
if err := ensureServerRunning(cmd.Context()); err != nil {
fmt.Fprintf(os.Stderr, "Error starting server: %v\n", err)