1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 21:55:08 +00:00
Commit Graph

15 Commits

Author SHA1 Message Date
Tw93
30c1a95731 Harden test mode against auth and uninstall side effects 2026-03-15 12:19:50 +08:00
Noah Qin
a9d7c3912f fix(sudo): add GUI mode support for non-TTY environments (#536)
When Mole is called from GUI applications (e.g., SwiftUI apps), the
request_sudo_access() function would fail with '/dev/tty: Device not
configured' error because /dev/tty is not available in non-TTY contexts.

This commit adds automatic detection of the runtime environment and uses
macOS native password dialog (via osascript) when running in GUI mode,
while preserving all existing TTY behavior including Touch ID support.

Changes:
- Detect TTY availability before attempting terminal-based authentication
- Use osascript to display native password dialog in GUI mode
- Maintain backward compatibility with all terminal-based workflows
- Ensure secure password handling (unset after use)

Fixes commands like 'mole clean', 'mole optimize', 'mole purge' when
invoked from GUI applications.
2026-03-05 09:35:26 +08:00
tw93
c19a0276b8 refactor: Update shell arithmetic increment syntax from ((var++)) || true to var=$((var + 1)) across various scripts. 2026-02-28 11:10:18 +08:00
tw93
7d70889ad4 chore: auto format code 2026-02-28 11:03:16 +08:00
tw93
e966838c82 style: standardize punctuation across codebase
- Replace parentheses with commas for supplementary info
- Use commas instead of em-dashes for separators
- Update bullet points from - to * in some contexts
- Improve version extraction regex with fallback logic
2026-01-26 14:36:06 +08:00
Tw93
3f85c8238f Use gray color for warning icons to reduce visual noise 2026-01-20 15:07:37 +08:00
程序员阿江(Relakkes)
f8cb96d328 fix: resolve password input issue with special characters
Remove -icanon mode from stty settings to fix password authentication
failures when passwords contain special characters like '.' or '@'.

The non-canonical mode (-icanon min 1 time 0) caused character loss
in Terminal.app. Using only -echo keeps canonical mode which provides
more reliable character handling across all terminal emulators.
2026-01-15 13:29:35 +08:00
Tw93
2394c5d768 feat(touchid): add sudo_local support with silent migration 2026-01-09 11:02:10 +08:00
Tw93
9f51da3211 Improve sudo prompt interaction with safe line clearing for a cleaner UI 2025-12-27 10:17:57 +08:00
Tw93
79e40b9c91 docs: Improve clarity and conciseness of comments and documentation 2025-12-18 17:35:54 +08:00
Tw93
be1027f9c3 refine sudo requirement checks for uninstallation. 2025-12-17 10:37:03 +08:00
Tw93
019a0c63ff fix: Enhance sudo password input handling and expand tilde paths in maintenance. 2025-12-16 17:54:37 +08:00
Tw93
80e3be710b Restructure common split content 2025-12-08 15:33:52 +08:00
Tw93
3b59920bab Simplify the debug code 2025-12-06 12:40:07 +08:00
Tw93
4bd4ffc7be Reconstruct clean lib code 2025-12-01 16:58:35 +08:00