Skip to content
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

weird % symbol on startup #5387

Open
k2662 opened this issue May 7, 2024 · 9 comments
Open

weird % symbol on startup #5387

k2662 opened this issue May 7, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@k2662
Copy link

k2662 commented May 7, 2024

What Operating System(s) are you seeing this problem on?

macOS

Screenshot of issue:

image

WezTerm version

20240203-110809-5046fc22 and 20240506-145255-0b50725f

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

a % symbol always shows at startup

To Reproduce

set zsh PS1 to PS1='%F{green}%1~>%f '

Configuration

local wezterm = require("wezterm")

local colors = require('themes/lua/rose-pine-moon').colors()

local window_frame = require('themes/lua/rose-pine-moon').window_frame()

return {
	-- OpenGL for GPU acceleration, Software for CPU, or WebGpu
	front_end = "WebGpu",

  term = "xterm-256color",

	colors = colors,

	-- Font config
	font = wezterm.font("JetBrainsMono Nerd Font", { weight="Medium", stretch="Normal", style="Normal" }),
	font_rules = {
		{
			italic = true,
			font = wezterm.font("JetBrainsMono Nerd Font", { weight="Medium", stretch="Normal", italic = true }),
		},
		{
			italic = false,
			font = wezterm.font("JetBrainsMono Nerd Font", { weight="Medium", stretch="Normal", bold = true }),
		},
		{
			intensity = "Bold",
			font = wezterm.font("JetBrainsMono Nerd Font", { weight="Bold", stretch="Normal", bold = true }),
		},
	},

	warn_about_missing_glyphs = false,
	font_size = 16,
	line_height = 1.0,

	-- Cursor style
	default_cursor_style = "BlinkingBar",

	bold_brightens_ansi_colors = true,
	-- Padding
	window_padding = {
		left = 6,
		right = 6,
		top = 6,
		bottom = 6,
	},

	-- Tab Bar
	enable_tab_bar = true,
	hide_tab_bar_if_only_one_tab = true,
	show_tab_index_in_tab_bar = false,
	tab_bar_at_bottom = true,

	-- General
	window_decorations = "RESIZE | MACOS_FORCE_DISABLE_SHADOW",
  macos_window_background_blur = 18,
	automatically_reload_config = true,
	window_background_opacity = 0.5,
	window_close_confirmation = "NeverPrompt",
	audible_bell = "Disabled",
  window_frame = window_frame,
}

My Theme

-- rose-pine-moon
-- Copyright (c) 2022 rose-pine

-- repository: https://github.com/neapsix/wezterm
-- license: MIT

local M = {}

local palette = {
    base = '#232136',
    overlay = '#393552',
    muted = '#6e6a86',
    text = '#e0def4',
    love = '#eb6f92',
    gold = '#f6c177',
    -- rose = '#ea9a97',
    pine = '#3e8fb0',
    foam = '#9ccfd8',
    iris = '#c4a7e7',
    -- highlight_high = '#56526e',
}

local active_tab = {
    bg_color = palette.overlay,
    fg_color = palette.text,
}

local inactive_tab = {
    bg_color = palette.base,
    fg_color = palette.muted,
}

function M.colors()
    return {
        foreground = palette.text,
        background = palette.base,
        cursor_bg = palette.text,
        cursor_border = '#59546d',
        cursor_fg = palette.text,
        selection_bg = palette.iris,
        selection_fg = palette.text,

        ansi = {
            palette.overlay,
            palette.love,
            palette.pine,
            palette.gold,
            palette.foam,
            palette.iris,
            '#ebbcba', -- replacement for palette.rose,
            palette.text,
        },

        brights = {
            '#817c9c', -- replacement for palette.muted,
            palette.love,
            palette.pine,
            palette.gold,
            palette.foam,
            palette.iris,
            '#ebbcba', -- replacement for palette.rose,
            palette.text,
        },

        tab_bar = {
            background = palette.base,
            active_tab = active_tab,
            inactive_tab = inactive_tab,
            inactive_tab_hover = active_tab,
            new_tab = inactive_tab,
            new_tab_hover = active_tab,
            inactive_tab_edge = palette.muted, -- (Fancy tab bar only)
        },
    }
end

function M.window_frame() -- (Fancy tab bar only)
    return {
        active_titlebar_bg = palette.base,
        inactive_titlebar_bg = palette.base,
    }
end

return M

Expected Behavior

There shouldn't be random % symbol at startup.
kitty terminal doesn't have this issue

Logs

10:05:29.412 INFO wezterm_gui::termwindow > QuitApplication over here (window)

Anything else?

No response

@k2662 k2662 added the bug Something isn't working label May 7, 2024
@bew
Copy link
Sponsor Contributor

bew commented May 7, 2024

Hello,
I'd suggest you to try to disable the code that shows you the os/host/kernel/uptime/.. and see if you still have this issue 🤔

@k2662
Copy link
Author

k2662 commented May 7, 2024

Hello, I'd suggest you to try to disable the code that shows you the os/host/kernel/uptime/.. and see if you still have this issue 🤔

I already tried that.

@bew
Copy link
Sponsor Contributor

bew commented May 7, 2024

Does that still reproduce without any config for wezterm? (using wezterm --skip-config)

If so, please make a recording of the exact output made to the terminal using wezterm record, and upload the result here for analysis 🙏

@k2662
Copy link
Author

k2662 commented May 7, 2024

yes it still has the % symbol, I cannot seem to get it to record, as it only happens when it takes up the entire screen but not when it is split like this:
image

it is macos so it uses the .app extension and does not use .desktop files like *bsd or linux. Due to this, it is difficult to use wezterm record.

but here:
{"version":2,"width":187,"height":47,"timestamp":1715105109,"command":"'/Applications/WezTerm.app/Contents/MacOS/wezterm --skip-config'","env":{"WEZTERM_TARGET_TRIPLE":"x86_64-apple-darwin", "LANG":"en_US.UTF-8","WEZTERM_VERSION":"20240506-145255-0b50725f"}}

@ninjalj
Copy link
Contributor

ninjalj commented May 8, 2024

That's zsh marking a partial line (a line that does not end in a newline before a prompt). See PROMPT_EOL_MARK on the zsh manual.

Maybe something is getting a wrong idea of wezterm's width in columns, attempting to move to the next line via outputting spaces, and failing?

@wez
Copy link
Owner

wez commented May 9, 2024

My hunch is that the window is being resized/maximized by something outside of wezterm (some local window manager extension?) very early during startup and that is racing with the window size being calculated/observed by your fetch program and zsh.

@k2662
Copy link
Author

k2662 commented May 10, 2024

My hunch is that the window is being resized/maximized by something outside of wezterm (some local window manager extension?) very early during startup and that is racing with the window size being calculated/observed by your fetch program and zsh.

makes sense. I use https://github.com/koekeishiya/yabai as my wm.

@wez
Copy link
Owner

wez commented May 10, 2024

I don't have any great suggestions for this; this class of early startup resize issue is a bit thorny to reconcile because, in wezterm, the ptys are started in the context of the multiplexer layer, which may not have a GUI, and the GUI is then notified of the pty and adjusts to render it. Synchronizing the startup/size with that is technically possible with some effort, but it would come at the cost of introducing some additional delay during startup which many users will not tolerate.

In the meantime, if it really bothers you, then you could try:

  • Setting initial_cols and initial_rows to the size that you want, so that wezterm launches the pty at your intended size, rather than the natural window size which is then changed by your WM while the pty is starting up
  • Adding a short delay after running your fetch program to give the system a chance to adapt to the new window size before zsh prints its prompt

@wez
Copy link
Owner

wez commented May 10, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants