Search code examples
xonsh

Copy xonsh history to a new computer


With bash I can just copy .bash_history from my old computer to the new one.

What should I do in xonsh?

The xonsh's history tutorial mentions that the history is stored in the json file indicated by the command history file. But I have the impression that this file points to other ones. So, I'm not sure which files I should bring to the new computer to preserve the history.


Solution

  • The history file command shows you the history file for the current session only in xonsh. xonsh uses a single history file per terminal emulator instance (unless you are using a custom back-end).
    If you want to copy over your xonsh history to a new computer, copy xonsh folder inside the directory specified by the env-var $XDG_DATA_HOME. That's where all of the history files live (by default it's ~/.local/share on posix-y systems)