mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2025-01-20 07:22:46 +08:00
Save history before replacing shell process
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.
This commit is contained in:
parent
3610868fb3
commit
8b8a7c8d73
|
@ -4,6 +4,9 @@
|
||||||
# OVERVIEW
|
# OVERVIEW
|
||||||
# Refresh (reload) the current fish session.
|
# Refresh (reload) the current fish session.
|
||||||
|
|
||||||
function refresh -d "refresh the fish session"
|
function refresh -d "Refresh fish session by replacing current process"
|
||||||
set -q CI; or exec fish < /dev/tty
|
if not set -q CI
|
||||||
|
history --save
|
||||||
|
exec fish < /dev/tty
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user