|   | 1 |  initial version  | 
I don't know how to do this in a terminal, but if you run SageMath in a Jupyter notebook (i.e. use ./sage -n jupyter), you can stop the execution of the code and keep your session by selecting Interrupt in the Kernel menu.
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.