-
Notifications
You must be signed in to change notification settings - Fork 113
feat: Profile option to open new terms in last focused term's CWD [rebased 2025-07-26] #257
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
base: master
Are you sure you want to change the base?
feat: Profile option to open new terms in last focused term's CWD [rebased 2025-07-26] #257
Conversation
b62121c
to
c261fb2
Compare
I think this should be under profiles. |
Do you mean as a per profile setting? |
Alright, I moved the setting over to Profiles. |
7a8f93a
to
e5bcfac
Compare
e5bcfac
to
3e33977
Compare
3e33977
to
01e605b
Compare
01e605b
to
3ea6722
Compare
3ea6722
to
d48fdc0
Compare
d48fdc0
to
369a497
Compare
369a497
to
6082f3b
Compare
This option would be great! I really miss it when using the cosmic terminal. |
Is this blocked on anything? It seems like a nice feature. |
This needs a rebase |
6082f3b
to
35a29cf
Compare
I rebased it. 😸 I force pushed to fix the formatting. While rebasing, I inadvertently added an extra indentation because the brackets were confusing. Code is still the same. |
35a29cf
to
ed78b73
Compare
ed78b73
to
822218e
Compare
Closes: pop-os#251 This patch implements an optional (but enabled by default) feature for opening new terminals using the focused terminal's working directory. The code to retrieve the CWD is largely based on Alacritty's implementation of the same feature. I added Rustix as a new direct dependency for the working directory logic. Both libc and Rustix are transitive dependencies of COSMIC Term. I opted for Rustix over libc to avoid an `unsafe` block as well as for its stronger type guarantees. References: * https://github.com/alacritty/alacritty/blob/6bd1674bd80e73df0d41e4342ad4e34bb7d04f84/alacritty/src/daemon.rs#L85-L108
The option is enabled by default on Unix but settable per profile. Windows is currently unsupported and defaults to the old behavior.
822218e
to
9f46076
Compare
@jackpot51 now that doesn't have merge conflicts, can it merge? |
I think there are too many places with cfg(not(windows)). I can help to simplify this change. |
Closes: #251
This patch implements an optional (but enabled by default) feature for opening new terminals using the focused terminal's working directory. The code to retrieve the CWD is largely based on Alacritty's implementation of the same feature.
It works but I have one small change to work on later.
Todo: