userInfo
userInfo returns the active user's login, home directory, and shell in one call, as a native UserInfo.
Signature
userInfo(): UserInfotyrus
import { UserInfo, userInfo } from "tyrus:os";
const info: UserInfo = userInfo();
print(`${info.username} (${info.shell})`);UserInfo Fields
| Field | Type | Meaning |
|---|---|---|
username | string | The login name (same as userName()). |
homedir | string | The home directory (same as homeDir()). |
shell | string | The user's default shell. |
