Replies: 4 comments 4 replies
|
going to pass on the folder level, but the container you're describing mostly exists already, it's called a window. a window is a named bundle of workspaces and sessions with its own sidebar, so Project A and Project B become two windows, each showing only its own workspaces. They're persisted and reopen at the next launch with their frames. It's all in the Window menu: New Window (⌘⌥N), Rename Window… to name it, Open Window to switch. Or from a script if you'd rather set the whole thing up at once: the reason I don't want an extra level in the tree is the model rather than the effort. Workspaces are peers, and a workspace holds the sessions for one project or context, so nesting them under a named parent pushes a convention that isn't universal (plenty of people, me included, don't organize workspaces to mirror a project layout). Same call as #259 and #265. "It stays optional" doesn't move me much on its own either, I closed an opt-in, default-off affordance in #248 because it's still one more flag and one more code path for something I'd keep off. windows aren't a free substitute though, and it's worth being straight about what they cost:
so pls try one window per project. If something specifically falls short after that, tell me what it is. |
|
Thanks for the detailed explanations and for putting together all these examples. I’m going to try the park / resume workflow for managing my projects. I actually like the idea of pre-generating the required workspaces and sessions, then opening them from the command palette. The window-based approach also looks useful for separating work and personal projects while still keeping the experience close to having a single window open. By the way, a small repository with scripts like these might be useful as a collection of practical recipes showing what can be done with agtermctl, as well as a source of ideas and inspiration for people building their own workflows. |
|
the sidebar half of this is in v0.18.0 (#297), so the gap I named above is gone. I said the built-in collapse keeps exactly one workspace, and that "keep project A's three workspaces open and fold the rest" is where a script starts paying. The focus filter now marks a set instead of a single workspace, so that part is built in. Right-click a workspace row and pick Add to Focus for each one you want, then the grid button in the sidebar's bottom bar shows only those. Focus on the same menu is unchanged, it still replaces the set with that one workspace. two things it does that the collapse script didn't:
the set and the filter flag are independent, which is the part that matters for your case. Turning the filter off keeps the marks, so peeking at the whole tree and coming back is one toggle each way rather than a rebuilt selection. That toggle is the same bottom-bar button, View ▸ Toggle Workspace Filter, or the over the socket:
so #!/bin/sh
# agt-only.sh "A" - show only the workspaces whose name starts with A
p=$1
agtermctl workspace filter off # unmark with the whole tree still on screen
agtermctl tree --json |
jq -r --arg p "$p" '.result.tree.workspaces[]
| "\(if (.name|startswith($p)) then "add" else "off" end) \(.id)"' |
while read -r mode w; do agtermctl workspace focus "$mode" --target "$w"; done
agtermctl workspace filter onone entry per project in the palette, same as before. Read-back is per workspace as three things worth knowing:
none of this is the folder level, it's still a flat set with no parent node, and park-and-resume is still the script from before. What it does cover is the "show me only this project" half, with no script at all if you don't mind clicking the rows. |
|
the collection suggested above now exists, under cookbook/. Seven recipes, each a directory with a README (what it does, requirements, setup, usage, how it works, limits) and its scripts. The three from this thread are in there: project-switcher, park-and-resume, window-per-project. cookbook/CONTRIBUTING.md covers submitting your own. the scripts I posted above have four bugs. Use the cookbook versions, not the ones in this thread. Reviewing them properly before shipping them turned these up:
one more that was wrong in my explanation rather than the code: I said the captured argv comes back absolute, so the snapshot also holds full argv for everything that was running, which can include a token or a password passed on a command line, so it now writes with none of this changes the answer about folders. What it does change is that "it's a script" is only a good answer if the script is somewhere findable and someone has actually checked it. |
Uh oh!
There was an error while loading. Please reload this page.
It would be useful to have an optional higher-level grouping mechanism for workspaces.
The current hierarchy is:
Workspace → Session
For larger setups, I would like to organize them as:
Folder → Workspace → Session
My main use case is working with several monorepo-based projects. Each project may contain multiple related workspaces, and each workspace may contain several sessions. With only the current two-level hierarchy, the workspace list becomes difficult to navigate because workspaces belonging to different projects are mixed together.
For example:
Ideally, folders could be collapsible in the sidebar and workspaces could be assigned to, moved between, or left outside a folder. The feature could remain entirely optional so the existing workflow would not change for users who do not need another hierarchy level.
This would make agterm easier to use when managing multiple large projects, monorepos, or collections of related repositories.
All reactions