Terminal.xo patch: do not die if the cwd is gone

paul fox pgf at laptop.org
Tue Nov 3 12:08:20 EST 2009

On Tue, Nov 3, 2009 at 11:04 AM, Martin Langhoff
<martin.langhoff at gmail.com> wrote:
> Attached is a trivial patch that handles gracefully the situation
> where cwd does not exist anymore or is no longer accessible to the
> olpc user.

frankly, i think the whole state-saving notion in Terminal (and other
terminal emulators i've seen) is flawed, and a bad idea, for
exactly this sort of reason.  shell sessions are _not_ restartable
without far more work than is being done now:  enviroment
variables are lost, background jobs are lost, aliases are gone,
mount points are different, etc etc. unlike the relatively closed
application environment that most activities live in, a terminal
shell has the whole system as its "current state".  far better to
not pretend to be restoring something which cannot be done --
the current behavior gives a very misleading impression of how
shells work.  if one wants to preserve state, the solution is
obvious:  don't kill Terminal in the first place -- just switch away from it.

(i understand the desire for restoring scrollback -- that's useful history.
but i think the old text should be greyed out, and/or there should be
a big "*End of previous session scrollback*" message separating it
from the new text.and current directory should not be restored.)


> Without it,
>  - mount a usb disk
>  - open Terminal.xo, change directory to /media/my-usb-disk/
>  - close Terminal.xo
>  - unmount / remove usb disk
>  - try to open Terminal.xo => fails to start
> cheers,
> m

 paul fox, pgf at laptop.org

More information about the Devel mailing list