On Windows, if there is an error attaching to the console of the child process (i.e. shell program), then Aminal crashes.
This PR adds correct handling of such errors.
Type of change
[X] Bug fix (non-breaking change which fixes an issue)
How Has This Been Tested?
Run aminal.exe -shell mosh.exe on Windows (providing mosh.exe is in the current directory). Aminal will terminate with a fatal error message (instead of crashing) and will display something like this:
E:\Projects\GO\src\github.com\liamg\aminal>aminal.exe -shell "mosh.exe"
1.5512818351698596e+09 info aminal/main.go:37 Allocating pty...
1.551281835395546e+09 fatal aminal/main.go:59 Failed to start your shell: Was not able to attach to the child prosess' console
main.initialize
E:/Projects/GO/src/github.com/liamg/aminal/main.go:59
main.main
E:/Projects/GO/src/github.com/liamg/aminal/main.go:20
runtime.main
E:/Go/src/runtime/proc.go:201
Description
On Windows, if there is an error attaching to the console of the child process (i.e. shell program), then Aminal crashes. This PR adds correct handling of such errors.
Type of change
How Has This Been Tested?
Run
aminal.exe -shell mosh.exe
on Windows (providingmosh.exe
is in the current directory). Aminal will terminate with a fatal error message (instead of crashing) and will display something like this:Test Configuration:
Windows