Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: first command of bash session is not saved #2491

Open
1 task done
N-Coder opened this issue Dec 20, 2024 · 7 comments
Open
1 task done

[Bug]: first command of bash session is not saved #2491

N-Coder opened this issue Dec 20, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@N-Coder
Copy link

N-Coder commented Dec 20, 2024

What did you expect to happen?

All commands that I execute should be saved in atuin's history.

What happened?

Whenever I open a new bash session (by opening a new terminal windows or by invoking bash), the first command executed is not saved by atuin. All further commands are saved as expected:

Screencast.From.2024-12-20.15-35-12.mp4

If I "cancel" the first command by pressing Ctrl+C, the next command is also saved as expected:

Screencast.From.2024-12-20.15-36-21.mp4

Atuin doctor output

2024-12-20T14:37:43.025026Z DEBUG atuin_client::database: opening sqlite database at "/home/finksim/.local/share/atuin/history.db"    
2024-12-20T14:37:43.026445Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\nPRAGMA synchronous = NORMAL;\n" rows_affected=0 rows_returned=1 elapsed=380.17µs elapsed_secs=0.00038017
2024-12-20T14:37:43.026517Z DEBUG atuin_client::database: running sqlite database setup    
2024-12-20T14:37:43.026862Z DEBUG sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  success BOOLEAN NOT NULL,\n  checksum BLOB NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=53.211µs elapsed_secs=5.3211e-5
2024-12-20T14:37:43.027119Z DEBUG sqlx::query: summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=136.286µs elapsed_secs=0.000136286
2024-12-20T14:37:43.027272Z DEBUG sqlx::query: summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=0 rows_returned=5 elapsed=57.642µs elapsed_secs=5.7642e-5
2024-12-20T14:37:43.027341Z DEBUG atuin_client::record::sqlite_store: opening sqlite database at "/home/finksim/.local/share/atuin/records.db"    
2024-12-20T14:37:43.028256Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\n" rows_affected=0 rows_returned=1 elapsed=383.628µs elapsed_secs=0.000383628
2024-12-20T14:37:43.028305Z DEBUG atuin_client::record::sqlite_store: running sqlite database setup    
2024-12-20T14:37:43.028629Z DEBUG sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  success BOOLEAN NOT NULL,\n  checksum BLOB NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=29.573µs elapsed_secs=2.9573e-5
2024-12-20T14:37:43.028857Z DEBUG sqlx::query: summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=108.715µs elapsed_secs=0.000108715
2024-12-20T14:37:43.028994Z DEBUG sqlx::query: summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=0 rows_returned=2 elapsed=52.087µs elapsed_secs=5.2087e-5
Atuin Doctor
Checking for diagnostics
2024-12-20T14:37:43.029105Z DEBUG atuin_client::database: opening sqlite database at "sqlite::memory:"    
2024-12-20T14:37:43.029786Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\nPRAGMA synchronous = NORMAL;\n" rows_affected=0 rows_returned=1 elapsed=187.852µs elapsed_secs=0.000187852
2024-12-20T14:37:43.029833Z DEBUG atuin_client::database: running sqlite database setup    
2024-12-20T14:37:43.030292Z DEBUG sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  success BOOLEAN NOT NULL,\n  checksum BLOB NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=262.755µs elapsed_secs=0.000262755
2024-12-20T14:37:43.030475Z DEBUG sqlx::query: summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=72.553µs elapsed_secs=7.2553e-5
2024-12-20T14:37:43.030593Z DEBUG sqlx::query: summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=0 rows_returned=0 elapsed=36.665µs elapsed_secs=3.6665e-5
2024-12-20T14:37:43.031349Z DEBUG sqlx::query: summary="-- Add migration script …" db.statement="\n\n-- Add migration script here\ncreate table if not exists history (\n  id text primary key,\n  timestamp integer not null,\n  duration integer not null,\n  exit integer not null,\n  command text not null,\n  cwd text not null,\n  session text not null,\n  hostname text not null,\n  unique(timestamp, cwd, command)\n);\ncreate index if not exists idx_history_timestamp on history(timestamp);\ncreate index if not exists idx_history_command on history(command);\n" rows_affected=0 rows_returned=0 elapsed=328.903µs elapsed_secs=0.000328903
2024-12-20T14:37:43.031664Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=115.418µs elapsed_secs=0.000115418
2024-12-20T14:37:43.031841Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=59.742µs elapsed_secs=5.9742e-5
2024-12-20T14:37:43.032308Z DEBUG sqlx::query: summary="create table if not …" db.statement="\n\ncreate table if not exists events (\n  id text primary key,\n  timestamp integer not null,\n  hostname text not null,\n  event_type text not null,\n  history_id text not null\n);\n-- Ensure there is only ever one of each event type per history item\ncreate unique index history_event_idx ON events(event_type, history_id);\n" rows_affected=2 rows_returned=0 elapsed=254.735µs elapsed_secs=0.000254735
2024-12-20T14:37:43.032475Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=32.125µs elapsed_secs=3.2125e-5
2024-12-20T14:37:43.032592Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=24.506µs elapsed_secs=2.4506e-5
2024-12-20T14:37:43.032756Z DEBUG sqlx::query: summary="-- Interactive search filters …" db.statement="\n\n-- Interactive search filters by command then by the max(timestamp) for that\n-- command. Create an index that covers those\ncreate index if not exists idx_history_command_timestamp on history(command, timestamp);\n" rows_affected=1 rows_returned=0 elapsed=63.527µs elapsed_secs=6.3527e-5
2024-12-20T14:37:43.032897Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=27.768µs elapsed_secs=2.7768e-5
2024-12-20T14:37:43.033000Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=18.451µs elapsed_secs=1.8451e-5
2024-12-20T14:37:43.033196Z DEBUG sqlx::query: summary="-- Add migration script …" db.statement="\n\n-- Add migration script here\ndrop table events;\n" rows_affected=1 rows_returned=0 elapsed=122.596µs elapsed_secs=0.000122596
2024-12-20T14:37:43.033343Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=30.517µs elapsed_secs=3.0517e-5
2024-12-20T14:37:43.033457Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=22.376µs elapsed_secs=2.2376e-5
2024-12-20T14:37:43.033690Z DEBUG sqlx::query: summary="-- Add migration script …" db.statement="\n\n-- Add migration script here\nalter table\n  history\nadd\n  column deleted_at integer;\n" rows_affected=1 rows_returned=0 elapsed=152.505µs elapsed_secs=0.000152505
2024-12-20T14:37:43.033836Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=27.976µs elapsed_secs=2.7976e-5
2024-12-20T14:37:43.033949Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=21.589µs elapsed_secs=2.1589e-5
2024-12-20T14:37:43.034558Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\nPRAGMA synchronous = NORMAL;\n" rows_affected=0 rows_returned=1 elapsed=66.913µs elapsed_secs=6.6913e-5
2024-12-20T14:37:43.034680Z DEBUG sqlx::query: summary="SELECT sqlite_version()" db.statement="" rows_affected=0 rows_returned=1 elapsed=35.736µs elapsed_secs=3.5736e-5


Please include the output below with any bug reports or issues

{
  "atuin": {
    "version": "18.3.0",
    "sync": {
      "cloud": true,
      "records": false,
      "auto_sync": true,
      "last_sync": "2024-12-20 14:20:32.689368994 +00:00:00"
    },
    "sqlite_version": "3.44.0"
  },
  "shell": {
    "name": "bash",
    "default": "bash",
    "plugins": [
      "atuin",
      "bash-preexec"
    ],
    "preexec": "none"
  },
  "system": {
    "os": "Fedora Linux",
    "arch": "x86_64",
    "version": "41",
    "disks": [
      {
        "name": "/dev/mapper/luks-499eaf53-d638-4e66-9184-f7c2bd1e5313",
        "filesystem": "btrfs"
      },
      {
        "name": "/dev/mapper/luks-499eaf53-d638-4e66-9184-f7c2bd1e5313",
        "filesystem": "btrfs"
      },
      {
        "name": "/dev/nvme0n1p2",
        "filesystem": "ext4"
      },
      {
        "name": "/dev/nvme0n1p1",
        "filesystem": "vfat"
      }
    ]
  }
}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@N-Coder N-Coder added the bug Something isn't working label Dec 20, 2024
@akinomyoga
Copy link
Contributor

  "shell": {
    "name": "bash",
    "default": "bash",
    "plugins": [
      "atuin",
      "bash-preexec"
    ],
    "preexec": "none"
  },

bash-preexec does not seem to be activated. What is the result of the following commands?

$ declare -p PROMPT_COMMAND
$ trap -p DEBUG

@N-Coder
Copy link
Author

N-Coder commented Dec 21, 2024

I'm starting a new shell and execute the commands respectively as first one, but the output doesn't seem to be different when executing it any time later.

finksim@sd959-x13:~$ bash
finksim@sd959-x13:~$ declare -p PROMPT_COMMAND
declare -a PROMPT_COMMAND=([0]=$'__bp_precmd_invoke_cmd\nprintf "\\033]0;%s@%s:%s\\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\\~}"\n:' [1]="__vte_precmd" [2]="__vte_osc7" [3]="__bp_interactive_mode")
finksim@sd959-x13:~$ trap -p DEBUG
trap -- '__bp_preexec_invoke_exec "$_"' DEBUG
finksim@sd959-x13:~$ declare -p PROMPT_COMMAND
declare -a PROMPT_COMMAND=([0]=$'__bp_precmd_invoke_cmd\nprintf "\\033]0;%s@%s:%s\\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\\~}"\n:' [1]="__vte_precmd" [2]="__vte_osc7" [3]="__bp_interactive_mode")
finksim@sd959-x13:~$ exit
exit
finksim@sd959-x13:~$ bash
finksim@sd959-x13:~$ trap -p DEBUG
trap -- '__bp_preexec_invoke_exec "$_"' DEBUG
finksim@sd959-x13:~$ declare -p PROMPT_COMMAND
declare -a PROMPT_COMMAND=([0]=$'__bp_precmd_invoke_cmd\nprintf "\\033]0;%s@%s:%s\\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\\~}"\n:' [1]="__vte_precmd" [2]="__vte_osc7" [3]="__bp_interactive_mode")
finksim@sd959-x13:~$ trap -p DEBUG
trap -- '__bp_preexec_invoke_exec "$_"' DEBUG
finksim@sd959-x13:~$ exit
exit

In contrast, it seems that "preexec": "none" is only there if atuin doctor is executed as first command:

finksim@sd959-x13:~$ bash
finksim@sd959-x13:~$ atuin doctor
2024-12-21T11:58:39.605742Z DEBUG atuin_client::database: opening sqlite database at "/home/finksim/.local/share/atuin/history.db"    
2024-12-21T11:58:39.607098Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\nPRAGMA synchronous = NORMAL;\n" rows_affected=0 rows_returned=1 elapsed=611.964µs elapsed_secs=0.000611964
2024-12-21T11:58:39.607227Z DEBUG atuin_client::database: running sqlite database setup    
2024-12-21T11:58:39.607831Z DEBUG sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  success BOOLEAN NOT NULL,\n  checksum BLOB NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=54.564µs elapsed_secs=5.4564e-5
2024-12-21T11:58:39.608409Z DEBUG sqlx::query: summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=164.843µs elapsed_secs=0.000164843
2024-12-21T11:58:39.608623Z DEBUG sqlx::query: summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=0 rows_returned=5 elapsed=69.261µs elapsed_secs=6.9261e-5
2024-12-21T11:58:39.608755Z DEBUG atuin_client::record::sqlite_store: opening sqlite database at "/home/finksim/.local/share/atuin/records.db"    
2024-12-21T11:58:39.610358Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\n" rows_affected=0 rows_returned=1 elapsed=744.427µs elapsed_secs=0.000744427
2024-12-21T11:58:39.610461Z DEBUG atuin_client::record::sqlite_store: running sqlite database setup    
2024-12-21T11:58:39.610854Z DEBUG sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  success BOOLEAN NOT NULL,\n  checksum BLOB NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=34.428µs elapsed_secs=3.4428e-5
2024-12-21T11:58:39.611124Z DEBUG sqlx::query: summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=114.089µs elapsed_secs=0.000114089
2024-12-21T11:58:39.611299Z DEBUG sqlx::query: summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=0 rows_returned=2 elapsed=63.778µs elapsed_secs=6.3778e-5
Atuin Doctor
Checking for diagnostics
2024-12-21T11:58:39.611485Z DEBUG atuin_client::database: opening sqlite database at "sqlite::memory:"    
2024-12-21T11:58:39.612240Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\nPRAGMA synchronous = NORMAL;\n" rows_affected=0 rows_returned=1 elapsed=123.484µs elapsed_secs=0.000123484
2024-12-21T11:58:39.612300Z DEBUG atuin_client::database: running sqlite database setup    
2024-12-21T11:58:39.612853Z DEBUG sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  success BOOLEAN NOT NULL,\n  checksum BLOB NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=269.552µs elapsed_secs=0.000269552
2024-12-21T11:58:39.613080Z DEBUG sqlx::query: summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=79.947µs elapsed_secs=7.9947e-5
2024-12-21T11:58:39.613234Z DEBUG sqlx::query: summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=0 rows_returned=0 elapsed=44.643µs elapsed_secs=4.4643e-5
2024-12-21T11:58:39.614136Z DEBUG sqlx::query: summary="-- Add migration script …" db.statement="\n\n-- Add migration script here\ncreate table if not exists history (\n  id text primary key,\n  timestamp integer not null,\n  duration integer not null,\n  exit integer not null,\n  command text not null,\n  cwd text not null,\n  session text not null,\n  hostname text not null,\n  unique(timestamp, cwd, command)\n);\ncreate index if not exists idx_history_timestamp on history(timestamp);\ncreate index if not exists idx_history_command on history(command);\n" rows_affected=0 rows_returned=0 elapsed=436.816µs elapsed_secs=0.000436816
2024-12-21T11:58:39.614428Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=63.341µs elapsed_secs=6.3341e-5
2024-12-21T11:58:39.614631Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=45.521µs elapsed_secs=4.5521e-5
2024-12-21T11:58:39.615217Z DEBUG sqlx::query: summary="create table if not …" db.statement="\n\ncreate table if not exists events (\n  id text primary key,\n  timestamp integer not null,\n  hostname text not null,\n  event_type text not null,\n  history_id text not null\n);\n-- Ensure there is only ever one of each event type per history item\ncreate unique index history_event_idx ON events(event_type, history_id);\n" rows_affected=2 rows_returned=0 elapsed=285.277µs elapsed_secs=0.000285277
2024-12-21T11:58:39.615458Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=50.138µs elapsed_secs=5.0138e-5
2024-12-21T11:58:39.615643Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=41.272µs elapsed_secs=4.1272e-5
2024-12-21T11:58:39.615913Z DEBUG sqlx::query: summary="-- Interactive search filters …" db.statement="\n\n-- Interactive search filters by command then by the max(timestamp) for that\n-- command. Create an index that covers those\ncreate index if not exists idx_history_command_timestamp on history(command, timestamp);\n" rows_affected=1 rows_returned=0 elapsed=109.736µs elapsed_secs=0.000109736
2024-12-21T11:58:39.616127Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=48.005µs elapsed_secs=4.8005e-5
2024-12-21T11:58:39.616304Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=38.34µs elapsed_secs=3.834e-5
2024-12-21T11:58:39.616592Z DEBUG sqlx::query: summary="-- Add migration script …" db.statement="\n\n-- Add migration script here\ndrop table events;\n" rows_affected=1 rows_returned=0 elapsed=177.103µs elapsed_secs=0.000177103
2024-12-21T11:58:39.616808Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=49.838µs elapsed_secs=4.9838e-5
2024-12-21T11:58:39.616992Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=42.092µs elapsed_secs=4.2092e-5
2024-12-21T11:58:39.617316Z DEBUG sqlx::query: summary="-- Add migration script …" db.statement="\n\n-- Add migration script here\nalter table\n  history\nadd\n  column deleted_at integer;\n" rows_affected=1 rows_returned=0 elapsed=199.217µs elapsed_secs=0.000199217
2024-12-21T11:58:39.617528Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=48.882µs elapsed_secs=4.8882e-5
2024-12-21T11:58:39.617715Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=41.474µs elapsed_secs=4.1474e-5
2024-12-21T11:58:39.618212Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\nPRAGMA synchronous = NORMAL;\n" rows_affected=0 rows_returned=1 elapsed=58.141µs elapsed_secs=5.8141e-5
2024-12-21T11:58:39.618305Z DEBUG sqlx::query: summary="SELECT sqlite_version()" db.statement="" rows_affected=0 rows_returned=1 elapsed=32.45µs elapsed_secs=3.245e-5


Please include the output below with any bug reports or issues

{
  "atuin": {
    "version": "18.3.0",
    "sync": {
      "cloud": true,
      "records": false,
      "auto_sync": true,
      "last_sync": "2024-12-20 14:20:32.689368994 +00:00:00"
    },
    "sqlite_version": "3.44.0"
  },
  "shell": {
    "name": "bash",
    "default": "bash",
    "plugins": [
      "atuin",
      "bash-preexec"
    ],
    "preexec": "none"
  },
  "system": {
    "os": "Fedora Linux",
    "arch": "x86_64",
    "version": "41",
    "disks": [
      {
        "name": "/dev/mapper/luks-499eaf53-d638-4e66-9184-f7c2bd1e5313",
        "filesystem": "btrfs"
      },
      {
        "name": "/dev/mapper/luks-499eaf53-d638-4e66-9184-f7c2bd1e5313",
        "filesystem": "btrfs"
      },
      {
        "name": "/dev/nvme0n1p2",
        "filesystem": "ext4"
      },
      {
        "name": "/dev/nvme0n1p1",
        "filesystem": "vfat"
      }
    ]
  }
}
finksim@sd959-x13:~$ atuin doctor
2024-12-21T11:58:46.056812Z DEBUG atuin_client::database: opening sqlite database at "/home/finksim/.local/share/atuin/history.db"    
2024-12-21T11:58:46.058202Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\nPRAGMA synchronous = NORMAL;\n" rows_affected=0 rows_returned=1 elapsed=655.594µs elapsed_secs=0.000655594
2024-12-21T11:58:46.058355Z DEBUG atuin_client::database: running sqlite database setup    
2024-12-21T11:58:46.058621Z DEBUG sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  success BOOLEAN NOT NULL,\n  checksum BLOB NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=25.701µs elapsed_secs=2.5701e-5
2024-12-21T11:58:46.058831Z DEBUG sqlx::query: summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=92.611µs elapsed_secs=9.2611e-5
2024-12-21T11:58:46.059193Z DEBUG sqlx::query: summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=0 rows_returned=5 elapsed=119.334µs elapsed_secs=0.000119334
2024-12-21T11:58:46.059289Z DEBUG atuin_client::record::sqlite_store: opening sqlite database at "/home/finksim/.local/share/atuin/records.db"    
2024-12-21T11:58:46.060308Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\n" rows_affected=0 rows_returned=1 elapsed=493.158µs elapsed_secs=0.000493158
2024-12-21T11:58:46.060364Z DEBUG atuin_client::record::sqlite_store: running sqlite database setup    
2024-12-21T11:58:46.060673Z DEBUG sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  success BOOLEAN NOT NULL,\n  checksum BLOB NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=31.154µs elapsed_secs=3.1154e-5
2024-12-21T11:58:46.060918Z DEBUG sqlx::query: summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=104.783µs elapsed_secs=0.000104783
2024-12-21T11:58:46.061084Z DEBUG sqlx::query: summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=0 rows_returned=2 elapsed=58.607µs elapsed_secs=5.8607e-5
Atuin Doctor
Checking for diagnostics
2024-12-21T11:58:46.061231Z DEBUG atuin_client::database: opening sqlite database at "sqlite::memory:"    
2024-12-21T11:58:46.061766Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\nPRAGMA synchronous = NORMAL;\n" rows_affected=0 rows_returned=1 elapsed=97.632µs elapsed_secs=9.7632e-5
2024-12-21T11:58:46.061811Z DEBUG atuin_client::database: running sqlite database setup    
2024-12-21T11:58:46.062254Z DEBUG sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS _sqlx_migrations (\n  version BIGINT PRIMARY KEY,\n  description TEXT NOT NULL,\n  installed_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,\n  success BOOLEAN NOT NULL,\n  checksum BLOB NOT NULL,\n  execution_time BIGINT NOT NULL\n);\n" rows_affected=0 rows_returned=0 elapsed=222.564µs elapsed_secs=0.000222564
2024-12-21T11:58:46.062445Z DEBUG sqlx::query: summary="SELECT version FROM _sqlx_migrations …" db.statement="\n\nSELECT\n  version\nFROM\n  _sqlx_migrations\nWHERE\n  success = false\nORDER BY\n  version\nLIMIT\n  1\n" rows_affected=0 rows_returned=0 elapsed=68.936µs elapsed_secs=6.8936e-5
2024-12-21T11:58:46.062575Z DEBUG sqlx::query: summary="SELECT version, checksum FROM …" db.statement="\n\nSELECT\n  version,\n  checksum\nFROM\n  _sqlx_migrations\nORDER BY\n  version\n" rows_affected=0 rows_returned=0 elapsed=37.178µs elapsed_secs=3.7178e-5
2024-12-21T11:58:46.063382Z DEBUG sqlx::query: summary="-- Add migration script …" db.statement="\n\n-- Add migration script here\ncreate table if not exists history (\n  id text primary key,\n  timestamp integer not null,\n  duration integer not null,\n  exit integer not null,\n  command text not null,\n  cwd text not null,\n  session text not null,\n  hostname text not null,\n  unique(timestamp, cwd, command)\n);\ncreate index if not exists idx_history_timestamp on history(timestamp);\ncreate index if not exists idx_history_command on history(command);\n" rows_affected=0 rows_returned=0 elapsed=402.879µs elapsed_secs=0.000402879
2024-12-21T11:58:46.063634Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=49.496µs elapsed_secs=4.9496e-5
2024-12-21T11:58:46.063817Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=38.54µs elapsed_secs=3.854e-5
2024-12-21T11:58:46.064553Z DEBUG sqlx::query: summary="create table if not …" db.statement="\n\ncreate table if not exists events (\n  id text primary key,\n  timestamp integer not null,\n  hostname text not null,\n  event_type text not null,\n  history_id text not null\n);\n-- Ensure there is only ever one of each event type per history item\ncreate unique index history_event_idx ON events(event_type, history_id);\n" rows_affected=2 rows_returned=0 elapsed=316.66µs elapsed_secs=0.00031666
2024-12-21T11:58:46.064775Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=49.155µs elapsed_secs=4.9155e-5
2024-12-21T11:58:46.064964Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=38.358µs elapsed_secs=3.8358e-5
2024-12-21T11:58:46.065168Z DEBUG sqlx::query: summary="-- Interactive search filters …" db.statement="\n\n-- Interactive search filters by command then by the max(timestamp) for that\n-- command. Create an index that covers those\ncreate index if not exists idx_history_command_timestamp on history(command, timestamp);\n" rows_affected=1 rows_returned=0 elapsed=82.881µs elapsed_secs=8.2881e-5
2024-12-21T11:58:46.065325Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=31.583µs elapsed_secs=3.1583e-5
2024-12-21T11:58:46.065441Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=20.938µs elapsed_secs=2.0938e-5
2024-12-21T11:58:46.065633Z DEBUG sqlx::query: summary="-- Add migration script …" db.statement="\n\n-- Add migration script here\ndrop table events;\n" rows_affected=1 rows_returned=0 elapsed=117.778µs elapsed_secs=0.000117778
2024-12-21T11:58:46.065796Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=29.886µs elapsed_secs=2.9886e-5
2024-12-21T11:58:46.065922Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=23.968µs elapsed_secs=2.3968e-5
2024-12-21T11:58:46.066166Z DEBUG sqlx::query: summary="-- Add migration script …" db.statement="\n\n-- Add migration script here\nalter table\n  history\nadd\n  column deleted_at integer;\n" rows_affected=1 rows_returned=0 elapsed=157.736µs elapsed_secs=0.000157736
2024-12-21T11:58:46.066311Z DEBUG sqlx::query: summary="INSERT INTO _sqlx_migrations ( …" db.statement="\n\nINSERT INTO\n  _sqlx_migrations (\n    version,\n    description,\n    success,\n    checksum,\n    execution_time\n  )\nVALUES\n  (?1, ?2, TRUE, ?3, -1)\n" rows_affected=1 rows_returned=0 elapsed=28.273µs elapsed_secs=2.8273e-5
2024-12-21T11:58:46.066424Z DEBUG sqlx::query: summary="UPDATE _sqlx_migrations SET execution_time …" db.statement="\n\nUPDATE\n  _sqlx_migrations\nSET\n  execution_time = ?1\nWHERE\n  version = ?2\n" rows_affected=1 rows_returned=0 elapsed=21.215µs elapsed_secs=2.1215e-5
2024-12-21T11:58:46.066967Z DEBUG sqlx::query: summary="PRAGMA journal_mode = WAL; …" db.statement="\n\nPRAGMA journal_mode = WAL;\nPRAGMA foreign_keys = ON;\nPRAGMA synchronous = NORMAL;\n" rows_affected=0 rows_returned=1 elapsed=59.65µs elapsed_secs=5.965e-5
2024-12-21T11:58:46.067067Z DEBUG sqlx::query: summary="SELECT sqlite_version()" db.statement="" rows_affected=0 rows_returned=1 elapsed=39.057µs elapsed_secs=3.9057e-5


Please include the output below with any bug reports or issues

{
  "atuin": {
    "version": "18.3.0",
    "sync": {
      "cloud": true,
      "records": false,
      "auto_sync": true,
      "last_sync": "2024-12-20 14:20:32.689368994 +00:00:00"
    },
    "sqlite_version": "3.44.0"
  },
  "shell": {
    "name": "bash",
    "default": "bash",
    "plugins": [
      "atuin",
      "bash-preexec"
    ],
    "preexec": "bash-preexec"
  },
  "system": {
    "os": "Fedora Linux",
    "arch": "x86_64",
    "version": "41",
    "disks": [
      {
        "name": "/dev/mapper/luks-499eaf53-d638-4e66-9184-f7c2bd1e5313",
        "filesystem": "btrfs"
      },
      {
        "name": "/dev/mapper/luks-499eaf53-d638-4e66-9184-f7c2bd1e5313",
        "filesystem": "btrfs"
      },
      {
        "name": "/dev/nvme0n1p2",
        "filesystem": "ext4"
      },
      {
        "name": "/dev/nvme0n1p1",
        "filesystem": "vfat"
      }
    ]
  }
}

My .bashrc is attached, /etc/bashrc is the Fedora (41) standard, and .bashrc.d does not exist.
.bash-preexec.sh is V0.5.0 and I'm using GNU bash, version 5.2.32(1)-release (x86_64-redhat-linux-gnu).

@mateuscomh
Copy link
Contributor

@N-Coder
Copy link
Author

N-Coder commented Dec 21, 2024

@N-Coder, here the .bash-preexec.sh https://docs.atuin.sh/guide/installation/#installing-the-shell-plugin

Yes, I have that one installed. The file on master says version 0.5.0.

@mateuscomh
Copy link
Contributor

@N-Coder, here the .bash-preexec.sh https://docs.atuin.sh/guide/installation/#installing-the-shell-plugin

Yes, I have that one installed. The file on master says version 0.5.0.

I have the same issue was you on the first command in bash, but when i put the .bash-preexec the new sessios register all entries.
I tried too on ble.sh and works too. Just for register

@N-Coder
Copy link
Author

N-Coder commented Dec 22, 2024

but when i put the .bash-preexec the new sessios register all entries

Sorry, I didn't catch that. What did you do? The .bash-preexec is loaded in my .bashrc.

@mateuscomh
Copy link
Contributor

but when i put the .bash-preexec the new sessios register all entries

Sorry, I didn't catch that. What did you do? The .bash-preexec is loaded in my .bashrc.

When I saw your topic, I didn't have .bash-preexec and had the same behavior.
What I meant is that after testing both ble.sh and .bash-preexec the registry worked for me both of them.
In your case as it is already loaded the bash-preexec I can not say what may be the problem, just wanted to tell what worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants