Thunderbird starts with two window instances
German Version: /post/2018/03/24/thunderbird-startet-mit-zwei-fenster-instanzen/
Problem description: Thunderbird always starts with two window instances, no matter how Thunderbird is started: via QuickStarter, from the K-Menu, or via console. If one of the two windows is closed, both always close.
Solution: The Thunderbird file ~/.thunderbird/*.default/session.json
contains two windows objects. Delete one of them.
Thunderbird's session.json
The content of the file can be displayed formatted on the console:
cat ~/.thunderbird/`awk -F "=" '/Path/ {print $2}' ~/.thunderbird/profiles.ini`"/session.json" | python -m json.tool
Example Output
{
"rev": 0,
"windows": [
{
"tabs": {
"rev": 0,
"selectedIndex": 0,
"tabs": [
{
"ext": {
"quickFilter": {
"filterValues": {
"text": {
"states": {
"body": false,
"recipients": false,
"sender": true,
"subject": false
},
"text": null
}
},
"visible": false
}
},
"mode": "folder",
"state": {
"firstTab": true,
"folderPaneVisible": true,
"folderURI": "xxx://xxx@example.com/INBOX",
"messagePaneVisible": true
}
}
]
},
"type": "3pane"
},
{
"tabs": {
"rev": 0,
"selectedIndex": 0,
"tabs": [
{
"ext": {
"quickFilter": {
"filterValues": {
"text": {
"states": {
"recipients": true,
"sender": true,
"subject": true
},
"text": null
}
},
"visible": true
}
},
"mode": "folder",
"state": {
"firstTab": true,
"folderPaneVisible": true,
"folderURI": "zzz://zzz@example.com/INBOX",
"messagePaneVisible": true
}
}
]
},
"type": "3pane"
}
]
}
As you can see in the above example output, the windows
array has more than one object. And exactly there is the problem: One Thunderbird window instance is created for each object.
Edit
The following small bash snippet first creates a copy (session.json.YYYYY-MM-DD
) of the current file (session.json
), formats (beautify | prettify) the JSON code so that it becomes more readable and finally opens the file in the editor Kate
:
- finish Thunderbird
-
open the file
~/.thunderbird/*.default/session.json
for editing with Kate via consolecd ~/.thunderbird/`awk -F "=" '/Path/ {print $2}' ~/.thunderbird/profiles.ini`;NOW=`date '+%Y-%m-%d_%H-%M-%S'`; cp session.json "session.json.$NOW"; cat session.json | python -m json.tool > /tmp/session.json; kate /tmp/session.json; cp /tmp/session.json session.json;
- remove the unwanted object in the JSON code
(Have the edited code checked with a JSON parser such as http://json.parser.online.fr/; copy'n'paste)._ - save file in Kate
[CTRL+S]
End Kate[CTRL+Q]
Now Thunderbird can be started again. It starts with only one window instance
Links
- "Thunderbird opens multiple windows on startup", binfalse.de, 2016-09-25, https://binfalse.de/2016/09/25/thunderbird-opens-multiple-windows-on-startup/
- "Thunderbird opens twice always", askubuntu, 2012-10-09, https://askubuntu.com/questions/198356/thunderbird-opens-twice-always
- A User Reply to "How can I pretty-print JSON in a (Unix) shell script?", stackoverflow, 2017-09-06, https://stackoverflow.com/a/1920585/2487859