liamg / darktile

:waning_crescent_moon: Darktile is a GPU rendered terminal emulator designed for tiling window managers.
MIT License
3.04k stars 112 forks source link

Add correct handling of attaching to child console errors #239

Closed vadymeng0 closed 5 years ago

vadymeng0 commented 5 years ago

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 (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

Test Configuration: