eshell-user-name

eshell-user-name is an alias for `user-login-name' in `esh-util.el'.

(eshell-user-name &optional UID)

Return the name under which the user logged in, as a string.
This is based on the effective uid, not the real uid.
Also, if the environment variables LOGNAME or USER are set,
that determines the value of this function.

If optional argument UID is an integer or a float, return the login name
of the user with that uid, or nil if there is no such user.