atuin icon indicating copy to clipboard operation
atuin copied to clipboard

[Bug]: script snippets run with all stdio redirected

Open rupor-github opened this issue 11 months ago • 1 comments

What did you expect to happen?

All programs started from inside the script should behave exactly as started independently without "atuin script run".

What happened?

When psql or mycli (or any program which checks if it has pty device attached and changes behavior if it is not) are being run as part of script snippet they do not show interactive prompts, making them pretty much useless.

This is not how "pet" which served as an inspiration for this feature (if I read history correctly) behaves.

Atuin doctor output

{
  "atuin": {
    "version": "18.6.1",
    "sync": {
      "cloud": true,
      "records": true,
      "auto_sync": true,
      "last_sync": "2025-05-12 0:44:06.216239695 +00:00:00"
    },
    "sqlite_version": "3.46.0"
  },
  "shell": {
    "name": "zsh",
    "default": "zsh",
    "plugins": [
      "atuin"
    ],
    "preexec": "built-in"
  },
  "system": {
    "os": "Debian GNU/Linux",
    "arch": "x86_64",
    "version": "12",
    "disks": [
      {
        "name": "none",
        "filesystem": "overlay"
      },
      {
        "name": "drivers",
        "filesystem": "9p"
      },
      {
        "name": "/dev/sdc",
        "filesystem": "ext4"
      },
      {
        "name": "/dev/sdc",
        "filesystem": "ext4"
      },
      {
        "name": "none",
        "filesystem": "overlay"
      },
      {
        "name": "none",
        "filesystem": "overlay"
      },
      {
        "name": "none",
        "filesystem": "overlay"
      },
      {
        "name": "C:\\134",
        "filesystem": "9p"
      },
      {
        "name": "D:\\134",
        "filesystem": "9p"
      }
    ]
  }
}

Code of Conduct

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

rupor-github avatar May 12 '25 01:05 rupor-github

I am not rust afficionado, and I am sure it could be done better, but just an example of how it could be done in such a way that interactive programs could be used in scripts: https://github.com/atuinsh/atuin/pull/2754

rupor-github avatar May 12 '25 01:05 rupor-github

I would also be very interested in this to be solved. Spent some time today trying to store an ssh command in Atuin scripts, but couldn't get it to behave properly

wholmen avatar Jun 14 '25 08:06 wholmen