atuin icon indicating copy to clipboard operation
atuin copied to clipboard

[Bug]: fish: `atuin dotfiles alias import` imports non-alias lines

Open rigrig opened this issue 10 months ago • 1 comments

What did you expect to happen?

I ran atuin dotfiles alias import under fish, and expected it to import (only) my fish aliases.

What happened?

Atuin imported my aliases, and the additional output that my fish generates on startup.

I have a fish script to show a formatted fortune cookie when starting:

> cat ~/.config/fish/conf.d/fortune.fish 
if status is-interactive
        fortune -a | cowsay -f (cowsay -l | tail -n+2 | xargs shuf -en1) | lolcat -t
end

Giving something like this: image

Atuin seems to have captured those lines as alias: atuin dotfiles alias list gives

                ||     ||=
                ||----w |=
           (___)\       )\/\=
         \ (ooo)\_______=
        \  ^___^=
 -----------------------------------------=
 _________________________________________=
/ If you permit yourself to read meanings \=
\ 416                                     /=
alias addr 'ip addr show dev enp2s0 | fgrep "inet "'=
... (snip: more aliases)
alias xl 'exa --icons --git --classify --long --header  --group-directories-first  --time-style=long-iso'
|                                         |=
| -- Michael Keith, "The Bar-Code Beast", |=
| The Skeptical Enquirer Vol 12 No 4 p    |=
| conclusion you like.                    |=
| into (rather than drawing meanings out  |=
| of) the evidence, you can draw any      |=

Opening a new terminal now always greets me with

- (line 77): Expected a command, but found '||'
alias                 ||     ||=''
                             ^^
from sourcing file -
        called on line 2 of file ~/.config/fish/conf.d/atuin.fish
from sourcing file ~/.config/fish/conf.d/atuin.fish
        called on line 248 of file /usr/share/fish/config.fish
from sourcing file /usr/share/fish/config.fish
        called during startup
source: Error while reading file '<stdin>'

Atuin doctor output

atuin:
  version: 18.2.0
  sync:
    cloud: false
    records: true
    auto_sync: true
    last_sync: 2024-04-16 10:11:50.497574363 +00:00:00
shell:
  name: fish
  default: unknown
  plugins: []
system:
  os: Linux Mint
  arch: x86_64
  version: '21.3'
  disks:
  - name: /dev/mapper/vgmint-root
    filesystem: ext4
  - name: /dev/sdb5
    filesystem: ext4
  - name: /dev/sdb1
    filesystem: vfat
  - name: /dev/mapper/luks-b22ba9d6-f908-4ce3-a5f5-925344879a4b
    filesystem: ext4

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

rigrig avatar Apr 16 '24 10:04 rigrig

same things happened under zsh.

Alsan avatar Apr 20 '24 07:04 Alsan

Alias import is disabled at the moment, and may be brought back if we can figure out a nicer way of doing it

ellie avatar Jun 17 '24 15:06 ellie