Skip to content
Discussion options

You must be logged in to vote

I would suggest using a user var named something like ZEN_MODE.

You can set it using something like:

printf "\033]1337;SetUserVar=%s=%s\007" ZEN_MODE `echo -n on | base64`

or turn it off:

printf "\033]1337;SetUserVar=%s=%s\007" ZEN_MODE `echo -n off | base64`

In your config, you can handle the zen mode changing using something like this:

local wezterm = require 'wezterm'

wezterm.on('user-var-changed', function(window, pane, name, value)
  local overrides = window:get_config_overrides() or {}
  if name == "ZEN_MODE" then
     if value == "on" then
       overrides.font_size = 18
     else
       overrides.font_size = nil
    end
  end
  window:set_config_overrides(overrides)  
end)

return

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mrossinek
Comment options

@wez
Comment options

wez Sep 24, 2022
Maintainer

@mrossinek
Comment options

@mrossinek
Comment options

Answer selected by mrossinek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants