atuinsh / atuin

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

[Bug]: Scroll position is not restored when using `inline_height` #2207

Open svenstaro opened 1 week ago

svenstaro commented 1 week ago

What did you expect to happen?

After exiting atuin, my terminal remains scrolled all the way up. I would expect the position to be restored to where I entered atuin.

What happened?

My terminal was scrolled way up, as many lines as inline_height defines.

Atuin doctor output

{
  "atuin": {
    "version": "18.3.0",
    "sync": {
      "cloud": false,
      "records": true,
      "auto_sync": true,
      "last_sync": "2024-06-28 20:17:50.083127172 +00:00:00"
    },
    "sqlite_version": "3.44.0"
  },
  "shell": {
    "name": "zsh",
    "default": "zsh",
    "plugins": [
      "atuin"
    ],
    "preexec": "built-in"
  },
  "system": {
    "os": "Arch Linux",
    "arch": "x86_64",
    "version": "rolling",
    "disks": [
      {
        "name": "/dev/mapper/cryptroot",
        "filesystem": "btrfs"
      },
      {
        "name": "/dev/nvme0n1p2",
        "filesystem": "vfat"
      }
    ]
  }
}

Code of Conduct

svenstaro commented 1 week ago

I'm not an expert on ANSI escape codes but I don't think this can be done using those. This probably needs terminal-specific stuff to be done. Something like this for wezterm or this for kitty. Most modern terminals seem to support this though it would likely be handled on a terminal-by-terminal basis.