Skip to content

Make a command like "/resume x" that can do the job of "/resume" and selecting with the picker in one command #2584

@Moaht

Description

@Moaht

Describe the feature or problem you'd like to solve

You cannot resume a session in one command from the command prompt or the copilot prompt when you do not know the session ID.

This is very inconvenient, especially in the case where the terminal or the host unexpectedly exits and there is no time to capture the session ID.

In this case we would like to easily reload the last session in one command.

Proposed solution

Make a command like "/resume x" that can do the job of "/resume" and selecting with the picker, but in one command and without session ID

You can use "/resume" to find and restore local sessions and select with arrow keys and choose with Enter without needing a session ID.
Each of these sessions are numbered from the most recent being 1. We should be able to just specify this number at /resume so that we can open that session in one command without specifying the session ID as we may not know it.

Doing something like "/resume 1" would be way more convenient than having to remember a session ID, in particular for cases when the client or terminal unexpectedly closes.

For my use-case, I'd like to see this feature implemented and have it be effective with the command flag "resume" as well, because I'd like to resume my GNU Screen sessions and have the last copilot sessions booted up and ready to go when I open Screen. I can already just about manage this, but it requires me to pipe in key presses, which is prone to timing errors, has more steps and isn't as convenient.

Obviously this might clash with the session id flag --resume= but I think since the session ids are all quite long, I think a purely numeric value that is less than the minimum session id length should be seen as an indicator that we mean this usage and not that one. Or else a different flag would be fine too.

Example prompts or workflows

S: copilot --resume=1

or

$: copilot
then
/resume 1

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions