mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-14 20:44:32 +02:00
Store the shell_integration option as a set
This commit is contained in:
@@ -108,10 +108,7 @@ def get_supported_shell_name(path: str) -> Optional[str]:
|
||||
|
||||
|
||||
def shell_integration_allows_rc_modification(opts: Options) -> bool:
|
||||
q = set(opts.shell_integration.split())
|
||||
if q & {'disabled', 'no-rc'}:
|
||||
return False
|
||||
return True
|
||||
return not bool(opts.shell_integration & {'disabled', 'no-rc'})
|
||||
|
||||
|
||||
def setup_shell_integration(opts: Options, env: Dict[str, str]) -> bool:
|
||||
@@ -133,9 +130,9 @@ def setup_shell_integration(opts: Options, env: Dict[str, str]) -> bool:
|
||||
|
||||
def modify_shell_environ(argv0: str, opts: Options, env: Dict[str, str]) -> None:
|
||||
shell = get_supported_shell_name(argv0)
|
||||
if shell is None or 'disabled' in set(opts.shell_integration.split()):
|
||||
if shell is None or 'disabled' in opts.shell_integration:
|
||||
return
|
||||
env['KITTY_SHELL_INTEGRATION'] = opts.shell_integration
|
||||
env['KITTY_SHELL_INTEGRATION'] = ' '.join(opts.shell_integration)
|
||||
if not shell_integration_allows_rc_modification(opts):
|
||||
return
|
||||
f = ENV_MODIFIERS.get(shell)
|
||||
|
||||
Reference in New Issue
Block a user