reedline icon indicating copy to clipboard operation
reedline copied to clipboard

Nushell locks the history file

Open Gorian opened this issue 3 years ago • 0 comments

Basic Info

Platform Linux, Ubuntu 20.04

Terminal software Windows Terminal

Nushell attempts to lock the history file. This means that nushell doesn't work when your home directory is mounted via a remote filesystem that doesn't support file locking, like NFSv3. I would think this could potentially cause issue with multiple instances of nushell via the same user as well.

Steps to reproduce

  1. Ensure your history file is on a non-locking filesystem, like NFSv3. Either by remotely mounting your home directory, or changing the file location
  2. run nushell. It will freeze while attempting to lock the file before exiting with an error.

strace

open("/home/net/$user/.config/nushell/history.txt", O_RDWR|O_CREAT|O_CLOEXEC, 0666) = 5
fcntl(5, F_SETFD, FD_CLOEXEC)           = 0
flock(5, LOCK_EX)                       = -1 EIO (Input/output error)
close(5)                                = 0
ioctl(1, TIOCGWINSZ, {ws_row=30, ws_col=120, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=30, ws_col=120, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(2, TIOCGWINSZ, {ws_row=30, ws_col=120, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(2, TIOCGWINSZ, {ws_row=30, ws_col=120, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(2, TIOCGWINSZ, {ws_row=30, ws_col=120, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(1, TIOCGWINSZ, {ws_row=30, ws_col=120, ws_xpixel=0, ws_ypixel=0}) = 0
ioctl(2, TIOCGWINSZ, {ws_row=30, ws_col=120, ws_xpixel=0, ws_ypixel=0}) = 0
write(2, "Error: ", 7Error: )                  = 7
write(2, "\n", 1
)                       = 1
write(2, "  \33[31m\303\227\33[0m I/O error (os erro"..., 36  × I/O error (os error 5)) = 36
write(2, "\n", 1
)                       = 1
write(2, "\n", 1
)                       = 1
sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
munmap(0x7f4376073000, 12288)           = 0
exit_group(1)                           = ?
+++ exited with 1 +++

Gorian avatar Oct 26 '22 19:10 Gorian