forked from genewildish/Mainline
fix(pipeline): Use config display value in auto-injection
- Change line 477 in controller.py to use self.config.display or "terminal" - Previously hardcoded "terminal" ignored config and CLI arguments - Now auto-injection respects the validated display configuration fix(app): Add warnings for auto-selected display - Add warning in pipeline_runner.py when --display not specified - Add warning in main.py when --pipeline-display not specified - Both warnings suggest using null display for headless mode feat(completion): Add bash/zsh/fish completion scripts - completion/mainline-completion.bash - bash completion - completion/mainline-completion.zsh - zsh completion - completion/mainline-completion.fish - fish completion - Provides completions for --display, --pipeline-source, --pipeline-effects, --pipeline-camera, --preset, --theme, --viewport, and other flags
This commit is contained in:
@@ -254,6 +254,16 @@ def run_pipeline_mode_direct():
|
||||
|
||||
# Create display using validated display name
|
||||
display_name = result.config.display or "terminal" # Default to terminal if empty
|
||||
|
||||
# Warn if display was auto-selected (not explicitly specified)
|
||||
if not display_name:
|
||||
print(
|
||||
" \033[38;5;226mWarning: No --pipeline-display specified, using default: terminal\033[0m"
|
||||
)
|
||||
print(
|
||||
" \033[38;5;245mTip: Use --pipeline-display null for headless mode (useful for testing)\033[0m"
|
||||
)
|
||||
|
||||
display = DisplayRegistry.create(display_name)
|
||||
if not display:
|
||||
print(f" \033[38;5;196mFailed to create display: {display_name}\033[0m")
|
||||
|
||||
@@ -189,10 +189,19 @@ def run_pipeline_mode(preset_name: str = "demo"):
|
||||
# CLI --display flag takes priority over preset
|
||||
# Check if --display was explicitly provided
|
||||
display_name = preset.display
|
||||
if "--display" in sys.argv:
|
||||
display_explicitly_specified = "--display" in sys.argv
|
||||
if display_explicitly_specified:
|
||||
idx = sys.argv.index("--display")
|
||||
if idx + 1 < len(sys.argv):
|
||||
display_name = sys.argv[idx + 1]
|
||||
else:
|
||||
# Warn user that display is falling back to preset default
|
||||
print(
|
||||
f" \033[38;5;226mWarning: No --display specified, using preset default: {display_name}\033[0m"
|
||||
)
|
||||
print(
|
||||
" \033[38;5;245mTip: Use --display null for headless mode (useful for testing/capture)\033[0m"
|
||||
)
|
||||
|
||||
display = DisplayRegistry.create(display_name)
|
||||
if not display and not display_name.startswith("multi"):
|
||||
|
||||
@@ -474,9 +474,10 @@ class Pipeline:
|
||||
not self._find_stage_with_capability("display.output")
|
||||
and "display" not in self._stages
|
||||
):
|
||||
display = DisplayRegistry.create("terminal")
|
||||
display_name = self.config.display or "terminal"
|
||||
display = DisplayRegistry.create(display_name)
|
||||
if display:
|
||||
self.add_stage("display", DisplayStage(display, name="terminal"))
|
||||
self.add_stage("display", DisplayStage(display, name=display_name))
|
||||
injected.append("display")
|
||||
|
||||
# Rebuild pipeline if stages were injected
|
||||
|
||||
Reference in New Issue
Block a user