New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Toggle ligatures in alternate-screen mode apps #5403
Comments
I'm not going to build this into wezterm. Look at https://wezfurlong.org/wezterm/config/lua/pane/is_alt_screen_active.html for a way to determine is the alt screen is active. You could combine those and use them in your https://wezfurlong.org/wezterm/config/lua/window-events/update-status.html to get something like the effect you're asking about. |
Cool, I will take a look. thank you! |
the following does not appear to work local w = require 'wezterm'
w.on('update-status', function(window, pane)
local wo = window:get_config_overrides() or {}
if pane:is_alt_screen_active() then
print('on')
wo.harfbuzz_features = { 'calt=1' }
else
print('off')
wo.harfbuzz_features = { 'calt=0' }
end
window:set_config_overrides(wo)
end) ligatures simply stayu always enabled. font setting is: font = w.font_with_fallback {
{
family = 'Berkeley Mono',
harfbuzz_features = { },
},
{
family = 'FiraCode Retina',
harfbuzz_features = { 'ss03', 'ss05' }
},
}, The event does not seem to fire as documented:
is it not intended to run every 1000ms by default? |
Many programming fonts that feature ligatures don't generally look great when applied to typical line-based terminal output like shells, package managers etc. They do however tend to work much better in TUI/ncurses apps like vim, lazygit, mc, etc.
Those apps use a control sequence to enter the "alternate screen" mode, which does not have scrollback. This allows those apps to preserve the previous terminal output on exit. (
smcup
/rmcup
control sequences).It would be awesome if wezterm was able to toggle font features (or possibly even fonts) when entering/exiting the alternate screen mode, so that I could have e.g. ligatures ON in vim, but ligatures OFF otherwise.
Maybe this is something that can already be implemented in Lua, I'm not sure.
The text was updated successfully, but these errors were encountered: