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

feat(#2040): rudimentary background session creation #2049

Closed
wants to merge 3 commits into from

Conversation

y-mx-b
Copy link

@y-mx-b y-mx-b commented Dec 26, 2022

Currently, the screen will be cleared upon opening a session with the --background flag, but attaching the session and then detaching it will result everything but the attach and detach commands being shown again; the terminal essentially "forgets" about those two and then redraws the previously cleared screen.

I'm not very familiar with ANSI escape codes or other terminal shenanigans, so I'd have to take a closer look at the start_client_impl() function in order to figure this out. If anyone could help me with this, that'd be great.

@sploders101
Copy link

sploders101 commented Dec 26, 2022

I haven't taken a lot of time to understand the problem, but your description sounds like this could be it. Check out the "Normal" and "Alternative" screen buffers in these docs. I think what may be happening is you're entering the "Alternative" screen buffer and not switching back to "normal" before exiting, so you'll need to keep Zellij from outputting those sequences when using the --background flag on startup.

If this is the case, you may have also noticed that either clicking or scrolling produces strange characters in your command prompt.

http://www.xfree86.org/4.7.0/ctlseqs.html

@y-mx-b
Copy link
Author

y-mx-b commented Dec 27, 2022

Alright, that sounds promising. Thanks for the docs, I'll take a look at this later.

@imsnif
Copy link
Member

imsnif commented Jan 6, 2023

Hey, what's the status here?

@y-mx-b
Copy link
Author

y-mx-b commented Jan 6, 2023

Hey, what's the status here?

I fixed the bug I mentioned before and haven't run into any obvious issues since.

@y-mx-b y-mx-b temporarily deployed to cachix January 6, 2023 13:40 — with GitHub Actions Inactive
@y-mx-b
Copy link
Author

y-mx-b commented Jan 9, 2023

Huh, that's odd. I see all tests passing on my M1 MacBook.

@y-mx-b y-mx-b temporarily deployed to cachix January 13, 2023 15:28 — with GitHub Actions Inactive
@imsnif
Copy link
Member

imsnif commented Jan 13, 2023

Hey @y-mx-b - thanks for your patience on this, and for picking up this issue.

We currently already have a facility to bypass all the screen clearing so that we won't have to do all the hard-work manually. We call is the cli_client (https://github.com/zellij-org/zellij/blob/main/zellij-client/src/cli_client.rs) and use it for interpreting cli actions. Maybe we can also use it in this case?

@y-mx-b
Copy link
Author

y-mx-b commented Jan 14, 2023

No problem @imsnif, it's for my own benefit anyway.

cli_client looks pretty helpful, is it being used in start_client in the current master branch? Because if it is, I could just try and update my fork with the current master.

@imsnif
Copy link
Member

imsnif commented Feb 20, 2023

Hey @y-mx-b - what's the status here? (no pressure, I just want to make sure I'm not blocking this through some misunderstanding)

@y-mx-b
Copy link
Author

y-mx-b commented Feb 22, 2023

@imsnif I haven't really taken a look at cli_client, since I've been focusing on other things instead. The feature (background session creation) itself was complete, but it looks like there are merge conflicts I need to resolve now, as I haven't kept my fork up to date.

@y-mx-b
Copy link
Author

y-mx-b commented Feb 22, 2023

I've pulled from the main repo on my fork and resolved merge conflicts. Formatting and testing has been done, and I've tested out the --background flag locally to make sure it still works.

@imsnif
Copy link
Member

imsnif commented Mar 28, 2023

Hey @y-mx-b - I'm a little confused here - would you like to give this a go through the CLI client as mentioned, or?

@y-mx-b
Copy link
Author

y-mx-b commented Dec 31, 2024

Forgot I had this PR. Closing because this feature was implemented in #3257.

@y-mx-b y-mx-b closed this Dec 31, 2024
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.

3 participants