MCPcopy Create free account
hub / github.com/RightNow-AI/rightnow-cli / show_exit_confirmation

Function show_exit_confirmation

rightnow_cli/cli_minimal.py:498–533  ·  view source on GitHub ↗

Show exit confirmation dialog. Returns: True to exit, False to continue

()

Source from the content-addressed store, hash-verified

496
497
498def show_exit_confirmation() -> bool:
499 """
500 Show exit confirmation dialog.
501
502 Returns:
503 True to exit, False to continue
504 """
505 from prompt_toolkit import prompt
506 from prompt_toolkit.formatted_text import HTML
507 from prompt_toolkit.styles import Style
508
509 style = Style.from_dict({
510 'prompt': '#76B900 bold',
511 })
512
513 console.print("[yellow]⚠️ Exit RightNow CLI?[/yellow]")
514 console.print()
515
516 while True:
517 try:
518 # Simple y/n prompt
519 answer = prompt(
520 HTML('<prompt> Exit? (y/n): </prompt>'),
521 style=style
522 ).strip().lower()
523
524 if answer in ['y', 'yes']:
525 return True
526 elif answer in ['n', 'no', '']:
527 return False
528 else:
529 console.print("[dim]Please enter 'y' for yes or 'n' for no[/dim]")
530
531 except (KeyboardInterrupt, EOFError):
532 # Second Ctrl+C or EOF = force exit
533 return True
534
535
536def interactive_mode(orchestrator: AgentOrchestrator):

Callers 1

interactive_modeFunction · 0.85

Calls 1

from_dictMethod · 0.45

Tested by

no test coverage detected