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
While working on issue #1263 it occurred to me it would be good if users didn't have to do something like this to write portable code:
use platform
var tty-name
if $platform:is-unix {
set tty-name = "/dev/tty"
} else if $platform:is-windows {
set tty-name = "con:"
} else {
fail "could not determine the tty device name"
}
I thought Go had a constant that defined the appropriate string for each supported platform but I can't find it. Regardless, this seems like something Elvish should provide via a $platform:tty-name variable.
The text was updated successfully, but these errors were encountered:
I looked at the Go source code and could not find a single mention of CON:. There are a handle of uses of /dev/tty but no constant that is exposed by the Go stdlib. That surprises me but I still believe adding a platform:tty-name variable will make it easier for a user to write portable Elvish code.
While working on issue #1263 it occurred to me it would be good if users didn't have to do something like this to write portable code:
I thought Go had a constant that defined the appropriate string for each supported platform but I can't find it. Regardless, this seems like something Elvish should provide via a
$platform:tty-name
variable.The text was updated successfully, but these errors were encountered: