Replies: 6 comments
-
|
agterm handles this through agtermctl session new --cwd /path/to/diragterm is fully driven by for cold start ( |
Beta Was this translation helpful? Give feedback.
-
|
Yes, I saw that in the docs. But I start terminals not from a script but from another binary program. Dealing with executing 2 binaries is possible, although it requires additional steps like waiting for the socket to become available. The benefit that I see- I can use it as quick action "open new terminal here {path}" in Finder and other programs as one action and don't check if it is running or not. Please reconsider this and add support for a starting directory. The difference with them is that they create a new window even if their instance is already running, instead of a tab as iTerm does. |
Beta Was this translation helpful? Give feedback.
-
|
the request makes sense for a Finder-style "open terminal here" action, and you're right that iTerm/kitty/ghostty all take iTerm and kitty treat windows as disposable, agterm doesn't: on launch it restores your full window/workspace/session tree, and the set of windows open at quit reopens next time. That's the core of the app, not an option you turn on. so the real question is what
there's also the "which window" question, iTerm drops a tab on the front window but agterm windows are named, persisted bundles, so there's no obvious "the window" to drop a the obvious fix for cold start is "skip restore, open one window at the path". That's worse than it looks:
so the warm case (agterm already running) is somewhat manageable, but still unclear. Even then it needs a call on what it actually does: add a session to the frontmost window, add a session to the first window, or open a new window with one session at the path. Cold start is the part that's really confusing, since agterm always restores your windows first. Unless we can settle on a clear, predictable, no-surprises mental model for how this behaves, I'd rather skip it. |
Beta Was this translation helpful? Give feedback.
-
|
I am still using iTerm and it has some capability to restore windows with tabs and the state in which they were closed so they are not fully disposable. I don't have a lot of experience with agterm, so maybe my preference will change later. For today, I will be happy with opening a new session/tab in the last active window/last active workspace. At least iTerm works this way (it does not have workspaces; I mean it uses windows). For agterm restoration, I guess it works next: For my preferences it is fine to add a new session/tab in that last active window. Another option is to use an additional argument to narrow user choice, if it is not too much to ask. For example, Another idea: if a workspace has a default name like "workspace 1/2/3...", then probably it is not intended for something persistent. In that case, find the last active window and the last active workspace with a default name. If there is no workspace with a default name, then create a new workspace. This, I think, will prevent breaking of the existing "stable" workspaces with the new sessions/tabs. |
Beta Was this translation helpful? Give feedback.
-
|
yes, iTerm does restore windows and tabs, so "disposable" was too broad from me. The difference is narrower than I put it, iTerm restores a flat list of windows and agterm restores a named workspace tree. your first option is the one that works, and it clears up what I was stuck on. The trick is that it doesn't skip restore at all:
that's one rule for both cases, no special cold-start path, nothing suppressed, nothing lost. On a cold start you get your whole restored setup plus the new session, in the window that was going to be activated anyway. It's not the clean single tab iTerm gives you, but it's predictable, which is what I was after. your read on restore is right btw, agterm already remembers the last active window and brings it up front on launch, so this maps onto what's already there. on on the default-workspace-name idea: I'd skip it. Guessing that a workspace is throwaway because it's still called "workspace 2" is the kind of magic that surprises people. Someone who never renames gets sessions dropped into their real workspace, someone who always renames gets a new workspace every time. Too unpredictable. so: a new session at the path in the last active window, same behavior whether agterm is running or not. That I can do. |
Beta Was this translation helpful? Give feedback.
-
I will be happy with such an implementation. Thank you! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I launch terminals from another app and want to specify the starting directory.
iTerm supports this via:
open -a iTerm /tmpIf no iTerm instance is running, it starts one and opens a new tab at the specified path. If an instance is already running, it just opens a new tab there.
Searching the agterm help with Claude Code, the only working combination I found was:
open -a agterm && agtermctl session new --cwd /tmpWould it be possible to update agterm to accept an argument on the agterm binary itself, so that it opens in a specific directory when it isn't running yet, and opens a new tab when it is already running?
Beta Was this translation helpful? Give feedback.
All reactions