Fix segfault when shrinking shell window