save last context for shell