Ask Your Question
0

how to delete all programs, inputs and output in the sage console ?

asked 4 years ago

andriam gravatar image

updated 4 years ago

I've tried all commands I know : reset(), !clear, %clear i, -ipython history clear, ipython history trim, --ipython locate profile default to clear history in my sage console but all of these do not work ,

,

Preview: (hide)

Comments

Hello, @andriam! In my case, writing reset() deletes all user-defined variables, and then clear cleans the console. Could you be more specific about your problem? What do you want to achieve? Perhaps and example?

dsejas gravatar imagedsejas ( 4 years ago )

If the goal is to clear the ipython history, this was asked and answered at

The rest of my comment expands on the comment by @dsejas.

If the goal is to recover the state of variables at the start of Sage, use

sage: reset()

If the goal is to get a clean terminal window with a fresh sage prompt and none of the previous computations visible, use

sage: clear

Note that after this clear command, you can still scroll back to see the previous input and output.

Of course, maybe what you really want to do is hit Ctrl+D to leave Sage, close the terminal window, open a new terminal window, and start a new fresh Sage session.

slelievre gravatar imageslelievre ( 4 years ago )

Hello, I want to clear all history what I have written on the console and all of the oitputs of all time so that onlly the word "sage :" remains in the console. That is, when I scroll back, I don't want to see all previous history

andriam gravatar imageandriam ( 4 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 4 years ago

dan_fulea gravatar image

Just start a new console and a new sage process inside it.

Preview: (hide)
link

Comments

Thanks to dan_fulea, this is what I use for the moment, but when scrolling back, using the back arrow, I still find the past history

andriam gravatar imageandriam ( 4 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 428 times

Last updated: Jul 25 '20