Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow detaching from TUI #275

Closed
adamcstephens opened this issue Nov 8, 2024 · 7 comments
Closed

Allow detaching from TUI #275

adamcstephens opened this issue Nov 8, 2024 · 7 comments
Labels
done Done, awaiting release enhancement New feature or request

Comments

@adamcstephens
Copy link

Feature Request

It would be great to be able to detach from the TUI and leave the services running. Along with detaching on up, this would allow one to attach temporary and then return to their shell.

Use Case:

Detaching is useful for automation, but sometimes you may want to check the services without committing a terminal.

Proposed Change:

Provide a keyboard shortcut that will detach and return to shell, while leaving the service running.

Who Benefits From The Change(s)?

Me?

Alternative Approaches

Status quo.

@F1bonacc1
Copy link
Owner

Hi @adamcstephens,
Did you try the CTRL+B shortcut and it didn't work for you?

@adamcstephens
Copy link
Author

CTRL+B seems to launch a new bash shell inside the TUI process, rather than completely detaching and exiting from the TUI. My default shell isn't bash, so this is also less than ideal from a user experience standpoint.

@F1bonacc1
Copy link
Owner

My default shell isn't bash, so this is also less than ideal from a user experience standpoint.

It's possible to override the default shell (bash) with the COMPOSE_SHELL env variable.

I am not sure I understood from the use case, why the existing detach functionality (-D) isn't enough for automation?

@F1bonacc1 F1bonacc1 added enhancement New feature or request need more info labels Nov 9, 2024
@adamcstephens
Copy link
Author

The detach functionality does indeed start the services in detached mode. But if one ever launches the TUI for any reason there seems to be no way to again truly detach from the server. Backgrounding the TUI and running a shell inside isn't the same as detaching and exiting the TUI without killing the processes. It also doesn't return me to where I was prior to attaching the TUI, but instead takes me somewhere new.

Put another way, I'd like to exit the TUI without killing the processes. Short of killing the window I don't see any way to do so.

Sorry, I figured this would be clearer and not a huge ask since the client/server and attach capabilities already existed. No worries if not, thanks for the consideration.

@F1bonacc1
Copy link
Owner

As you correctly pointed out there is no true detach after starting in TUI mode. That's why I was trying to understand the use case a bit better. Is it more of a "quick shell access" or an actual detached mode?

I can look into it.
I don't think it should be too difficult to implement it.
Today I start another instance of PC as a background process (child) and exit the parent. Instead of exiting, I think I can attach it to the child PC.
There might be some conflicting arguments between the server and the client, but I believe that can be sorted out.

@F1bonacc1 F1bonacc1 added done Done, awaiting release and removed need more info labels Nov 30, 2024
F1bonacc1 added a commit that referenced this issue Dec 20, 2024
@F1bonacc1
Copy link
Owner

Added in v1.46.0
Use it with the --detached-with-tui flag.
Please let me know if everything is as expected.

@adamcstephens
Copy link
Author

Thank you! I see one can also detach if launched with --detached as well. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Done, awaiting release enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants