-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add interactive directory actions popover to status bar #536
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?
Conversation
|
If you want to change only Current Directory then you should modify iTermStatusBarWorkingDirectoryComponent, not iTermStatusBarVariableBaseComponent. I don't think these actions make sense for other subclasses of iTermStatusBarVariableBaseComponent like username and hostname. Also, why not stick with the existing NSMenu? It has the benefit of allowing mouse-down+drag and is a more consistent look with other components that show menus on click (git, actions, and snippets). |
|
@gnachman Like this? |
|
@gnachman Thanks, I will check this. I'm not sure what I'm doing here, but I do feel it's frustrating not having any action on that widget. We are missing an opportunity here. If you have any good idea, happy to implement it. |
Introduce iTermDirectoryActionsViewController to provide a popover with directory actions (copy path, copy basename, open in Finder, open in new window/tab) when clicking the working directory status bar component. Implements delegate protocol for action handling and integrates with status bar UI. Updates iTermStatusBarVariableBaseComponent to use the new popover and delegate methods.
… command Refactor session launch logic in iTermStatusBarVariableBaseComponent.m to set the working directory and custom directory directly in the profile dictionary, replacing the previous approach of passing a shell command. This ensures the session starts in the intended directory and improves reliability when launching bookmarks.
012c84a to
3acdc50
Compare
|
Done! Changed both methods to use the mutable profile copy pattern with KEY_WORKING_DIRECTORY and KEY_CUSTOM_DIRECTORY. Thanks for the feedback! |
|
I would just put this in an NSMenu instead of creating a whole new view controller by adding it to the existing openMenuWithView: method. |
Summary
This PR enhances the Current Directory widget in iTerm2's status bar with an interactive popover interface, similar to the existing Job Name widget functionality.
Changes
When clicking on the Current Directory status bar widget, users now see a popover with 5 useful actions:
Implementation Details
iTermDirectoryActionsViewControllerfor the popover UIiTermStatusBarWorkingDirectoryComponentto show popover on clickeffectiveAppearanceiTermSessionLauncherfor opening new windows/tabsTesting
The feature has been implemented following iTerm2's existing patterns and should work seamlessly with both light and dark modes.
Screenshots
The popover provides a clean, native macOS interface that matches iTerm2's visual style and adapts to the current appearance mode.