mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Ensure the cwd is not changed, whilst remaining a logon shell
This commit is contained in:
@ -841,6 +841,12 @@ const Subprocess = struct {
|
||||
break :hush if (dir.access(".hushlogin", .{})) true else |_| false;
|
||||
} else false;
|
||||
|
||||
const cmd = try std.fmt.allocPrint(
|
||||
alloc,
|
||||
"exec -l {s}",
|
||||
.{opts.full_config.command orelse default_path},
|
||||
);
|
||||
|
||||
// The reason for executing login this way is unclear. This
|
||||
// comment will attempt to explain but prepare for a truly
|
||||
// unhinged reality.
|
||||
@ -883,9 +889,11 @@ const Subprocess = struct {
|
||||
// Awesome.
|
||||
try args.append("/usr/bin/login");
|
||||
if (hush) try args.append("-q");
|
||||
try args.append("-fp");
|
||||
try args.append("-flp");
|
||||
try args.append(username);
|
||||
try args.append(opts.full_config.command orelse default_path);
|
||||
try args.append("/bin/sh");
|
||||
try args.append("-c");
|
||||
try args.append(cmd);
|
||||
break :args try args.toOwnedSlice();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user