Run in detached mode

Created on 31 July 2025, 16 days ago

Problem/Motivation

The process-compose TUI (text user interface) is pretty slick, showing lots of detail of the running system -- but it also takes over your entire shell, and you end up needing to work in a different shell.

Process-compose has a --detach argument that allows you to run it in the background, with no TUI.

So setting up a target to run this headless makes it more similar to using DDev.

Steps to reproduce

We need a command to start it detached, and shut it down. It would be great to have some sort of indicator of when it's running.

Proposed resolution

start-detached -- new command to start up process-compose with --no-tui and --detached.

stop-detached -- shut down process-compose when it's running detached

Remaining tasks

Implement.

User interface changes

New commands and nix run targets.

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States freelock Seattle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @freelock
  • πŸ‡ΊπŸ‡ΈUnited States freelock Seattle

    This is now working locally. Going to test more broadly.

    I've also stubbed in a Starship prompt module, but it's not working...

  • πŸ‡ΊπŸ‡ΈUnited States freelock Seattle

    Ok! Whole new process handling is now working. See the new commands available in the devshell with '?'.

    In short, after refreshing the flake to get the latest, and entering the dev shell with `nix develop` or direnv, there are new commands for starting without the process-compose TUI (text user interface). This is built for running in existing Drupal projects -- the demo still uses the TUI, at least for now.

    So, to get started with this, go into a local Drupal copy and either:

    nix flake init -t gitlab:project/drupal_flake?host=git.drupalcode.org (new install)

    or

    nix develop
    refresh-flake (existing install).

    Then:

    start-detached

    and then you can follow the URL printed to see your site!

    There are a few new shell scripts that start with "pc-", which are wrappers for process-compose:

    - pc-status -- check the status of process-compose
    - pc-attach -- attach to the TUI (you can detach by pressing the F10 key -- when attached this way this only closes the TUI, it does not shut down the project).
    - pc-stop -- Stop the current project
    - stop-all -- stop all process-compose processes, including other projects

    Finally, there's an extra feature added here -- if you use the Starship prompt - https://starship.rs/ - you can install a starship module that will show when you are in a Drupal-flake project that is running. When process-compose is running in your project, you'll see a waterdrop and snowflake emoji, followed by your project name, right in the prompt:

    ... you can install it in your user profie using "setup-starship-prompt".

Production build 0.71.5 2024