Skip to content

In TTY mode prevent screen refreshes after completion of run action #94

@smetroid

Description

@smetroid

When using TTY mode, is it possible to not refresh the Sunbeam screen when the command succeeds?

I have an Ansible playbook I am running and if there are some errors in the playbook I would like the sunbeam screen not to refresh so I have a chance to view the results.

https://github.com/smetroid/sunbeam-extensions/blob/main/ansible-playbooks.sh

if [ "$COMMAND" = "ansible-options" ]; then
    echo $OPTIONS | jq '{
            "items": map({
            "title": .,
            "subtitle": (" ... run "+ (. | split("-")[1]) +  " roles on a " + (. | split("-")[0]) + " localhost"),
                "actions": [
                    {
                        "type": "run",
                        "title": ("Run Ansible Playbook for " + .),
                        "command": "run-ansible",
                        "params": {
                            "os": . | split("-")[0],
                            role: . | split("-")[1],
                        },
                        reload: false
                    }
                ]
            })
        }'
        exit 0
fi

I thought the reload option set to false would allow me to do this, but it doesn't appear to work as I thought it would.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions