By the way, I'm a little puzzled by the vte_restart() code - we kill the shell, set pid to 0, but who restarts it? And cannot we get the pid in this case?
Just to resolve this confusion: the restart of the shell was previously done in Geany and so the pid got set properly. But then we removed the start code because of a VTE bug and so pid kept 0 and broke other things :(. #2116 tries to fix that.
JFYI, it won't help this issue.