Skip to content

fix: convert enabled string to boolean in custom commands#1056

Open
dmzoneill wants to merge 1 commit intognome-terminator:masterfrom
dmzoneill-forks:fix/issue-1047-customcommands-boolean
Open

fix: convert enabled string to boolean in custom commands#1056
dmzoneill wants to merge 1 commit intognome-terminator:masterfrom
dmzoneill-forks:fix/issue-1047-customcommands-boolean

Conversation

@dmzoneill
Copy link

Summary

  • Fixes disabled custom commands appearing in the right-click menu
  • Properly converts string 'False'/'True' values to boolean

Details

The enabled flag from config was being stored as a string ('False' or 'True') instead of being converted to boolean. Since non-empty strings are truthy in Python, the expression s["enabled"] and s["enabled"] or False would evaluate to the string "False" for disabled commands, causing them to still appear in the menu.

The fix:

  1. Uses s.get("enabled", False) for safer access
  2. Explicitly checks if the value is a string
  3. Converts string values ("true", "1", "yes") to boolean True, others to False

Testing

  • Verified the logic handles both string and boolean values correctly
  • Disabled commands will now properly evaluate to False and not appear in the menu

Fixes #1047

The enabled flag from config was stored as string 'False'/'True'
instead of being converted to boolean. This caused disabled commands
to still appear in the right-click menu because non-empty strings
are truthy in Python.

Now properly converts string values to boolean.

Fixes gnome-terminator#1047
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabled CustomCommands keep appearing on right clik menu

2 participants