Skip to content

Dev#2

Merged
vincent067 merged 2 commits intomainfrom
dev
Mar 3, 2026
Merged

Dev#2
vincent067 merged 2 commits intomainfrom
dev

Conversation

@vincent067
Copy link
Copy Markdown
Collaborator

This pull request introduces a comprehensive "daemon mode" for running tasks in non-interactive or supervised environments (such as supervisor, systemd, or nohup). The changes ensure that the application automatically detects when it's running without a TTY and disables interactive features, enforces line-buffered output, and switches subprocesses to PIPE mode for maximum compatibility and clean logging. The documentation is updated to explain usage and configuration for daemon mode, including supervisor and systemd examples.

Key changes include:

Daemon Mode Implementation:

  • Added a --daemon CLI flag and automatic detection of non-TTY environments to enable daemon mode, which disables interactive features (like Rich Live panel and terminal title updates), forces PIPE subprocess mode, and ensures line-buffered output for compatibility with supervisors and logging systems (task_runner/cli.py, task_runner/commands/run_cmd.py, task_runner/display/core.py). [1] [2] [3]
  • Exported new daemon mode helpers (is_daemon_mode, enable_daemon_mode, auto_detect_daemon_mode) for use across modules (task_runner/display/__init__.py). [1] [2]
  • Suppressed terminal title escape sequences and interactive Rich Live panel when in daemon mode to prevent log corruption (task_runner/display/core.py, task_runner/display/tracker.py). [1] [2] [3] [4]

Executor and Output Handling:

  • Modified task execution to always use PIPE mode in daemon mode, bypassing PTY to avoid errors in non-terminal environments; improved output handling to avoid writing escape sequences and handle closed pipes gracefully (task_runner/executor.py). [1] [2] [3] [4] [5] [6]

Documentation Updates:

  • Updated the user guide with new sections and examples for daemon mode, including supervisor and systemd configuration, behavioral differences in daemon mode, and best practices for notifications (docs/USER_GUIDE.md). [1] [2] [3] [4]
  • Updated the feature list in README.md to mention daemon mode support.

@vincent067 vincent067 merged commit 76dcaea into main Mar 3, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants