mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
8b8a7c8d73
Fixes an issue with history between shell reloads via refresh function call. As `exec` replaces the current process in a non-gently fashion, the persistent history could be out of sync with the in-memory history. Calling `history --save` before `exec` should force the shell to persist the history before replacing the current process.
13 lines
229 B
Fish
13 lines
229 B
Fish
# SYNOPSIS
|
|
# refresh
|
|
#
|
|
# OVERVIEW
|
|
# Refresh (reload) the current fish session.
|
|
|
|
function refresh -d "Refresh fish session by replacing current process"
|
|
if not set -q CI
|
|
history --save
|
|
exec fish < /dev/tty
|
|
end
|
|
end
|