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

Function get_minimal_input

rightnow_cli/ui/modern_input.py:220–281  ·  view source on GitHub ↗

Ultra-minimal input - just a clean prompt. Rock-solid fallback that always works. Returns: User input string

()

Source from the content-addressed store, hash-verified

218
219
220def get_minimal_input() -> str:
221 """
222 Ultra-minimal input - just a clean prompt.
223 Rock-solid fallback that always works.
224
225 Returns:
226 User input string
227 """
228 # Ensure cursor is visible
229 _ensure_cursor_visible()
230 _safe_flush()
231
232 try:
233 terminal_width = _get_terminal_width()
234 separator = "─" * terminal_width
235
236 # Print separator
237 try:
238 console.print()
239 console.print(f"[dim]{separator}[/dim]")
240 except:
241 print()
242 print("-" * terminal_width)
243
244 # Show prompt
245 try:
246 console.print(" [green]▸[/green] ", end="")
247 except:
248 sys.stdout.write(" > ")
249
250 _safe_flush()
251
252 # Get input
253 try:
254 user_input = input()
255
256 # Print bottom separator
257 try:
258 console.print(f"[dim]{separator}[/dim]")
259 console.print()
260 except:
261 print("-" * terminal_width)
262 print()
263
264 return user_input.strip()
265
266 except (EOFError, KeyboardInterrupt):
267 # Print separator before raising
268 try:
269 console.print(f"[dim]{separator}[/dim]")
270 console.print()
271 except:
272 print("-" * terminal_width)
273 print()
274 raise
275
276 except Exception:
277 # Ultimate fallback - just use plain input

Callers 3

interactive_modeFunction · 0.85
get_modern_inputFunction · 0.85
get_boxed_inputFunction · 0.85

Calls 3

_ensure_cursor_visibleFunction · 0.85
_safe_flushFunction · 0.85
_get_terminal_widthFunction · 0.85

Tested by

no test coverage detected