atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
20.61k stars 560 forks source link

'unknown option' when attempting to retrieve complex fish commands #1232

Closed wcork closed 1 year ago

wcork commented 1 year ago

Describe the bug When attempting to retrieve a complex command from history in the fish shell.

To Reproduce Steps to reproduce the behavior:

  1. Configure atuin for Fish a. installed via cargo. b. fish config: ~/.config/fish/config.fish

    if status --is-interactive
    set -gx ATUIN_NOBIND "true"
    atuin init fish | source
    # bind to ctrl-r in normal and insert mode, add any other bindings you want here too
    bind \cr _atuin_search
    end
  2. use a complex command

    ffmpeg6 \
    -r 60 -pattern_type glob -i './sequence/video_*.png' \
    -i ./video.wav \
    -c:v libx265 -pix_fmt yuva420p \
    -b:v:1 8300k -maxrate:v:1 8300k -bufsize:v:1 16600k -filter:v:1 'scale=-2:720' -map 0:v:0 \
    -b:a 128k -c:a libopus -map 1:a:0 \
    -dash_segment_type mp4 -media_seg_name 'segment_$RepresentationID$_$Number$.m4s' -use_timeline 0 -adaptation_sets "id=0,streams=v id=1,streams=a" -streaming 1 -seg_duration 2 -init_seg_name 'init_$RepresentationID$.mp4' \
    -hls_playlist 1 \
    ./out/main.mpd
  3. Recall the command through Ctrl-R and pressing Return in the Atuin history.

  4. The following is returned to the console:

    
    commandline: -r 60 -pattern_type glob -i './sequence/video_*.png' \: unknown option

(Type 'help commandline' for related documentation)



**Expected behavior**
The complex command is expected to be ready in the command line.

**Error logs**
In repro steps.

**Device (please complete the following information):**
 - OS: Linux Mint
 - Shell: Fish
 - Version 16.0.0

**Self hosted**
No

**Additional context**
No
mokshasoul commented 1 year ago

I also have this issue, it was also reported here

ellie commented 1 year ago

I think this may be a dupe of https://github.com/atuinsh/atuin/issues/1211

I'm not at my computer right now, but can check if the proposed fix in that issue works over the weekend. Unless anyone beats me to it!