1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-28 15:56:28 +00:00
starship/src
KOVACS Krisztian c9c3455e23
fix(windows): fix windows terminal ANSI escape sequences (#2258)
* fix(windows): don't inherit stdin when executing commands

On Windows, inheriting stdin from starship might lead to leaking the
console reference to the command we're executing. `id.exe` supplied with
Git has been observed to disable the ENABLE_VIRTUAL_TERMINAL_PROCESSING
console flag if it inherits stdin -- leading to Windows Terminal not
processing ANSI escape sequences.

This change fixes #2254 by explicitly disabling stdin inheritance.

The fix was suggested by David Knaack.

* fix(username): don't call `id -u` on Windows

This was done to check if user is root by comparing the UID to 0. Windows
does not have a concept of UID 0 anyway, so it's pointless to call `id.exe`
(which is installed with MSYS2 or Git, for example).
2021-02-02 14:58:18 -05:00
..
configs feat(vagrant): Add support for Vagrant (#1812) 2021-01-30 12:05:16 +01:00
formatter refactor: simplify StringFormatter::new 2021-01-22 11:50:12 -05:00
init feat: add support for elvish shell (#1725) 2021-02-02 12:59:55 +01:00
modules fix(windows): fix windows terminal ANSI escape sequences (#2258) 2021-02-02 14:58:18 -05:00
test test: enable logging in tests (#2151) 2021-01-16 13:25:58 +01:00
bug_report.rs feat: add support for elvish shell (#1725) 2021-02-02 12:59:55 +01:00
config.rs fix(config): log as error if failure to read config wasn't caused by NotFound (#1993) 2020-12-13 16:24:48 +01:00
configure.rs feat(command): add 'toggle' command (#1917) 2021-01-07 19:04:06 +01:00
context.rs feat: add support for elvish shell (#1725) 2021-02-02 12:59:55 +01:00
lib.rs build: Add additional build information to version and bug report (#2124) 2021-01-22 20:14:51 +01:00
logger.rs test: enable logging in tests (#2151) 2021-01-16 13:25:58 +01:00
main.rs feat: add support for elvish shell (#1725) 2021-02-02 12:59:55 +01:00
module.rs feat(vagrant): Add support for Vagrant (#1812) 2021-01-30 12:05:16 +01:00
print.rs refactor: simplify print::handle_module 2021-01-22 11:50:12 -05:00
segment.rs chore: remove unused name from Segment and remove some of the misleading underscores (#1584) 2020-08-16 22:16:05 -04:00
utils.rs fix(windows): fix windows terminal ANSI escape sequences (#2258) 2021-02-02 14:58:18 -05:00