mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
config: config to disable auto secure input and secure input overlay
This commit is contained in:
@ -550,6 +550,8 @@ extension Ghostty {
|
|||||||
|
|
||||||
static func setPasswordInput(_ userdata: UnsafeMutableRawPointer?, value: Bool) {
|
static func setPasswordInput(_ userdata: UnsafeMutableRawPointer?, value: Bool) {
|
||||||
let surfaceView = self.surfaceUserdata(from: userdata)
|
let surfaceView = self.surfaceUserdata(from: userdata)
|
||||||
|
guard let appState = self.appState(fromView: surfaceView) else { return }
|
||||||
|
guard appState.config.autoSecureInput else { return }
|
||||||
surfaceView.passwordInput = value
|
surfaceView.passwordInput = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -371,6 +371,22 @@ extension Ghostty {
|
|||||||
let str = String(cString: ptr)
|
let str = String(cString: ptr)
|
||||||
return AutoUpdate(rawValue: str) ?? defaultValue
|
return AutoUpdate(rawValue: str) ?? defaultValue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var autoSecureInput: Bool {
|
||||||
|
guard let config = self.config else { return true }
|
||||||
|
var v = false;
|
||||||
|
let key = "macos-auto-secure-input"
|
||||||
|
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
|
var secureInputOverlay: Bool {
|
||||||
|
guard let config = self.config else { return true }
|
||||||
|
var v = false;
|
||||||
|
let key = "macos-secure-input-overlay"
|
||||||
|
_ = ghostty_config_get(config, &v, key, UInt(key.count))
|
||||||
|
return v
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +205,8 @@ extension Ghostty {
|
|||||||
#if canImport(AppKit)
|
#if canImport(AppKit)
|
||||||
// If we have secure input enabled and we're the focused surface and window
|
// If we have secure input enabled and we're the focused surface and window
|
||||||
// then we want to show the secure input overlay.
|
// then we want to show the secure input overlay.
|
||||||
if (secureInput.enabled &&
|
if (ghostty.config.secureInputOverlay &&
|
||||||
|
secureInput.enabled &&
|
||||||
surfaceFocus &&
|
surfaceFocus &&
|
||||||
windowFocus) {
|
windowFocus) {
|
||||||
SecureInputOverlay()
|
SecureInputOverlay()
|
||||||
|
@ -12,7 +12,7 @@ pub const fish_completions = comptimeGenerateFishCompletions();
|
|||||||
|
|
||||||
fn comptimeGenerateFishCompletions() []const u8 {
|
fn comptimeGenerateFishCompletions() []const u8 {
|
||||||
comptime {
|
comptime {
|
||||||
@setEvalBranchQuota(16000);
|
@setEvalBranchQuota(17000);
|
||||||
var counter = std.io.countingWriter(std.io.null_writer);
|
var counter = std.io.countingWriter(std.io.null_writer);
|
||||||
try writeFishCompletions(&counter.writer());
|
try writeFishCompletions(&counter.writer());
|
||||||
|
|
||||||
|
@ -1348,6 +1348,34 @@ keybind: Keybinds = .{},
|
|||||||
/// find false more visually appealing.
|
/// find false more visually appealing.
|
||||||
@"macos-window-shadow": bool = true,
|
@"macos-window-shadow": bool = true,
|
||||||
|
|
||||||
|
/// If true, Ghostty on macOS will automatically enable the "Secure Input"
|
||||||
|
/// feature when it detects that a password prompt is being displayed.
|
||||||
|
///
|
||||||
|
/// "Secure Input" is a macOS security feature that prevents applications from
|
||||||
|
/// reading keyboard events. This can always be enabled manually using the
|
||||||
|
/// `Ghostty > Secure Keyboard Entry` menu item.
|
||||||
|
///
|
||||||
|
/// Note that automatic password prompt detection is based on heuristics
|
||||||
|
/// and may not always work as expected. Specifically, it does not work
|
||||||
|
/// over SSH connections, but there may be other cases where it also
|
||||||
|
/// doesn't work.
|
||||||
|
///
|
||||||
|
/// A reason to disable this feature is if you find that it is interfering
|
||||||
|
/// with legitimate accessibility software (or software that uses the
|
||||||
|
/// accessibility APIs), since secure input prevents any application from
|
||||||
|
/// reading keyboard events.
|
||||||
|
@"macos-auto-secure-input": bool = true,
|
||||||
|
|
||||||
|
/// If true, Ghostty will show a graphical overlay when secure input is
|
||||||
|
/// enabled. This overlay is generally recommended to know when secure input
|
||||||
|
/// is enabled.
|
||||||
|
///
|
||||||
|
/// Normally, secure input is only active when a password prompt is displayed
|
||||||
|
/// or it is manually (and typically temporarily) enabled. However, if you
|
||||||
|
/// always have secure input enabled, this overlay can be distracting and
|
||||||
|
/// you may want to disable it.
|
||||||
|
@"macos-secure-input-overlay": bool = true,
|
||||||
|
|
||||||
/// Put every surface (tab, split, window) into a dedicated Linux cgroup.
|
/// Put every surface (tab, split, window) into a dedicated Linux cgroup.
|
||||||
///
|
///
|
||||||
/// This makes it so that resource management can be done on a per-surface
|
/// This makes it so that resource management can be done on a per-surface
|
||||||
|
Reference in New Issue
Block a user