(Fix): spawnSession now calls SetBasicVariables, SetDisplay, SetSessionParams, SetSeatVars, SetSessionVars, and SetXDGCommonPaths before spawning the desktop. fixes setupX failing immediately with missing DISPLAY/XDG_VTNR/HOME env vars because none were set
This commit is contained in:
@@ -36,6 +36,7 @@ first public release
|
||||
- **makefile `deps` target** — added `make deps` to automatically install `libpam0g-dev` and `build-essential`, and verify go is present
|
||||
- **readme overhaul** — rewrote for clarity: added "what problem does this solve", "how it works", known issues, simpler install instructions, and proper dependency listing
|
||||
- **view cleanup** — removed the non-functional automata background overlay from `View()` (the `Frame()` was never called, and the black-space placeholder caused `EEEE` garbage characters on some terminals). also removed a hardcoded 80-char width on the top bar so it adapts to the terminal
|
||||
- **session environment setup** — `spawnSession` now calls `SetBasicVariables`, `SetDisplay`, `SetSessionParams`, `SetSeatVars`, `SetSessionVars`, and `SetXDGCommonPaths` before spawning the desktop. fixes `setupX` failing immediately with `missing DISPLAY/XDG_VTNR/HOME env vars` because none were set
|
||||
|
||||
### What's Missing
|
||||
|
||||
|
||||
10
src/main.go
10
src/main.go
@@ -156,6 +156,16 @@ func spawnSession(res *login.Result) error {
|
||||
return fmt.Errorf("pam session: %w", err)
|
||||
}
|
||||
|
||||
session.SetBasicVariables(creds.Username, creds.HomeDir, creds.Shell, res.Config.InitialPath)
|
||||
if res.Env.Kind == "x11" {
|
||||
session.SetDisplay(res.Config.X11.Display)
|
||||
}
|
||||
session.RemoveXDG()
|
||||
session.SetSessionParams(res.Env.Kind)
|
||||
session.SetSeatVars(res.Config.TTY)
|
||||
session.SetSessionVars(creds.UID)
|
||||
session.SetXDGCommonPaths(creds.HomeDir)
|
||||
|
||||
sess, err := session.Spawn(&res.Env, creds.UID, creds.PrimaryGID, creds.AllGIDs, &res.Config)
|
||||
if err != nil {
|
||||
return fmt.Errorf("spawn: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user