nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.98k stars 1.8k forks source link

bug: atuin not recording history in bash #5958

Open pbek opened 2 weeks ago

pbek commented 2 weeks ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

When I enter a command in a bash, no history is written. In fish, the history is written correctly to atuin. I've enabled atuin via home-manager using:

      atuin = {
        enable = true;
        enableFishIntegration = true;
        enableBashIntegration = true;
        # https://docs.atuin.sh/configuration/config/
        # Writes ~/.config/atuin/config.toml
        settings = {
          sync_address = "https://myserver";
          sync_frequency = "15m";
          key_path = "/home/${username}/.secrets/atuin-key";
          enter_accept = true;  # Enter runs command
          style = "compact";  # No extra box around UI
          inline_height = 32; # Maximum number of lines Atuin’s interface should take up
          prefers_reduced_motion = true;  # No automatic time updates
          workspaces = true;  # Filter in directories with git repositories
        };
      };

It works great with fish:

With bash:

My ~./bashrc shows the correct:

if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then
  source "/nix/store/xzfiimwq0li4d2xjgi0c3dfb5zg1yzxi-bash-preexec-0.5.0/share/bash/bash-preexec.sh"
  eval "$(/nix/store/csc2lny869byz6v2177qm498wlg22ssp-atuin-18.3.0/bin/atuin init bash )"
fi

Maybe it's an issue with bash-preexec? See https://docs.atuin.sh/guide/installation/#installing-the-shell-plugin. There is an issue noted where some history entries are not written.

Maintainer CC

@hawkw

System information

nixos-unstable

 - system: `"x86_64-linux"`
 - host os: `Linux 6.11.0, NixOS, 24.11 (Vicuna), 24.11.20241009.5633bcf`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.24.8`
 - channels(root): `"nixos"`
 - nixpkgs: `/run/current-system/nixpkgs`
pbek commented 1 week ago

When I turn off enableBashIntegration and run this in a bash:

source "/nix/store/xzfiimwq0li4d2xjgi0c3dfb5zg1yzxi-bash-preexec-0.5.0/share/bash/bash-preexec.sh"
eval "$(/nix/store/csc2lny869byz6v2177qm498wlg22ssp-atuin-18.3.0/bin/atuin init bash )"

Then the same happens. I can show the atuin history with Ctrl + R or Up, but no history items are written.

pbek commented 1 week ago

I haven't got things working with ble.sh either...