You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logname(1) calls getlogin(2), and getlogin(2) should return the correct username under a login-shell, but it doesn't.
Launching the shell with login(1) make logname(1) behave as expected, so here is my workaround:
if wezterm.target_triple:find("darwin") ~= nil then
local USER = os.getenv("USER")
local SHELL = os.getenv("SHELL")
config.default_prog = { '/usr/bin/login', '-fpq', USER, SHELL, '-li' }
end
The text was updated successfully, but these errors were encountered:
What Operating System(s) are you seeing this problem on?
macOS 15.0 Sequoia
Which Wayland compositor or X11 Window manager(s) are you using?
N/A
WezTerm version
20240922-151228-2b76c63b
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
When running logname(1) on macOS, it returns
root
, not the name of the current user.In Terminal.app and Kitty, the command returns the current user.
To Reproduce
Just run logname(1)
Configuration
None
Expected Behavior
logname(1) should return the username of the current user.
Logs
N/A
Anything else?
The discussion at kovidgoyal/kitty#6511 seems be related. This is the solution they landed on.
logname(1) calls getlogin(2), and getlogin(2) should return the correct username under a login-shell, but it doesn't.
Launching the shell with login(1) make logname(1) behave as expected, so here is my workaround:
The text was updated successfully, but these errors were encountered: