showing SQL error: near "77": syntax error (from xterm-palette.json) when switching to another logfile
lnav version 0.12.4-1 on debian trixie
Description
When switching the logfile I always get the following error
SQL error: near "77": syntax error
;77;rgb:5f5f/d7d7/5f5f
The id 77 and the rgb color are defined in https://github.com/tstack/lnav/blob/9efadb1e883704b9f36937d064894cadc06f8825/src/xterm-palette.json#L1158
To Reproduce Steps to reproduce the behavior:
- start lnav
- config /ui/theme monocai (don't know if that is necessary)
- close lnav
- lnav /var/log/messages
- close lnav
- lnav /var/log/syslog
my config.json :
{
"ui": {
"theme": "monocai",
"theme-defs": {
"default": {
"highlights": {
"colors": {
"pattern": "(?:#[a-fA-F0-9]{6}|#[a-fA-F0-9]{3}\b)"
},
"ipv4": {
"pattern": "\b(?<!\d\.)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b(?!\.\d)"
},
"xml": {
"pattern": "</?([^ >=!]+)[^>]>"
},
"xml-decl": {
"pattern": "<!([^ >=!]+)[^>]>"
}
}
}
}
},
"log": {
"demux": {
"container": {
"pattern": "^(?:\x1b\[\dK)?(?<mux_id>[a-zA-Z0-9][\@a-zA-Z0-9_\.\-])\s+\| (?
The ;77;rgb:5f5f/d7d7/5f5f stuff is an escape sequence that wasn't processed properly. The terminal is sending it to lnav and instead of handling it properly, it's mistaken as being user input. Since the semi-colon opens the SQL prompt and "77" is not valid SQL, SQLite complains with the given error message.
What terminal are you using?
I'm using https://apps.kde.org/yakuake/ that is based on kde's konsole.
echo $TERM xterm-256color
Hmm, I can't seem to replicate the issue in yakuake yet. Will go through the code more and see if I can find anything. There is a v0.13.1-beta3 release, can you try that and see if it's still a problem? Thanks
The error appears to be related to how sessions are saved and restored. Specifically, the error occurs after a view-info-.json file is created for a log file. If I open a log file that doesn't have a corresponding view-info-.json file, the error doesn't appear. However, after closing lnav and reopening the same log, the error is present.
I've found that resetting the session with Ctrl+r sometimes resolves the issue temporarily.
I've attached a view-info-*.json file where the error consistently occurs, as well as my environment variables, which I hope will be helpful.
I understand that the beta version might address this, but I am currently on vacation with limited access and am unable to compile it at this time.
view-info-f2f914dda0bf33660dcffac4df225683.ts1755247586.ppid8703.json