Sample Header Ad - 728x90

Why doesn't my sqlite3 history work after I run a dotnet core web app?

1 vote
1 answer
100 views
Over the past year or two I've been using sqlite3 a lot for web development projects. Invariably I would stumble upon a problem where suddenly, the history of commands would no longer work (when pressing up arrow you get command history, just like you do in bash). **FYI** I'm running Ubuntu 22.04.3 LTS (6.5.0-21-generic) and .NET Core 8.0.200 **What I've Tried** I couldn't figure this out. * I examined my ~/.sqlite_history file and it looked normal. * checked for $SQLITE_HISTORY env variable but I don't have this and it still works (more below) * Updated to the latest version of sqlite3 (3.45.1 2024-01-30) * I've researched quite a few issues related to this, but still couldn't figure out why suddenly, the history didn't work. **Edit - Tried Console App, Also Causes Problem** 1. Opened a new terminal 2. Opened a sqlite3 db and tested the history command -- it works. 3. Exited sqlite3 back to command line (same terminal) 4. Ran a .NET Core console app which outputs "Hello, World" to the console and exits. (started with dotnet run) 5. Opened same sqlite3 db from step 2. Tried history. History no longer works in this terminal window. **Finally Discovered What Causes the Problem** I finally discovered why sqlite3 history doesn't work. However, I don't understand why this causes an issue. To reproduce the problem I have to: 1. start dotnet core web app Example: ($ dotnet run --project myWebApi) 2. stop the webapi (CTRL-C) 3. start sqlite3 to examine my db -- at this point I have no history (pushing up arrow provides no results) **A Clue To The Issue** If I open a new terminal and run sqlite3 then I do have history again. The dotnet core app is running as me and I don't think there is anything odd happening there, but I'm not sure. Do you know why this is happening? The solution ended up being: $ tput init or at the sqlite command line > .shell tput init
Asked by raddevus (123 rep)
Mar 7, 2024, 04:21 PM
Last activity: Oct 16, 2024, 11:52 AM