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

zellij/commands: Prevent recursive sessions #1766

Merged
merged 2 commits into from
Oct 13, 2022

Conversation

har7an
Copy link
Contributor

@har7an har7an commented Oct 1, 2022

with session names specified in layout files. A "recursive session" is created when, while running inside some zellij session, a user attempts to spawn zellij and make it attach to that same session.

When attaching via CLI (zellij attach) we explicitly check for this condition and error out when needed.

However, besides zellij attach it is also possible to declare the session to attach to in layout files like so:

session:
  name: "foo"

This takes a different codepath when starting zellij, and hence bypases the checks we already have in place to avoid recursive sessions. Hence, we implement the check in the other codepath, too, and prevent recursive sessions from happening for good.

Fixes: #1735

@har7an har7an temporarily deployed to cachix October 1, 2022 12:27 Inactive
@har7an har7an temporarily deployed to cachix October 1, 2022 12:28 Inactive
@har7an
Copy link
Contributor Author

har7an commented Oct 1, 2022

@imsnif or @a-kenji could either of you have a quick look over this? I'm not sure whether this is the right place to fix the issue. I did some tests, but I'd like to avoid users being unable to start their sessions in the next release.

@har7an har7an temporarily deployed to cachix October 11, 2022 14:30 Inactive
with session names specified in layout files. A "recursive session" is
created when, while running inside some zellij session, a user attempts
to spawn zellij and make it attach to that same session.

When attaching via CLI (`zellij attach`) we explicitly check for this
condition and error out when needed.

However, besides `zellij attach` it is also possible to declare the
session to attach to in layout files like so:

```yaml
session:
  name: "foo"
```

This takes a different codepath when starting zellij, and hence bypases
the checks we already have in place to avoid recursive sessions. Hence,
we implement the check in the other codepath, too, and prevent recursive
sessions from happening for good.

Fixes: zellij-org#1735
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.

Zellij layout with session name called inside the session causes recoursive calamity
1 participant