More on the Termius upgrade
#364 Henry, Tuesday, 19 June 2018 2:02 PM (Category: Apple)
(Tags: ssh ipad iphone)

Termius got back to me, asking about an environment variable - LC_ALL. I don't have that environment variable, but it did give me a line of experimentation, and I worked out what is happening.

I use the bash shell. I have two settings that control the command line history.

In .bashrc, I have

shopt histappend

and in .bash_profile, I have


These options combined give me large amounts of command line history. When I start a shell, it loads .bash_history into memory, all 10,000 lines of it, and appends each command to the list in memory, truncating as it goes. When I exit the shell, it appends the memory list to .bash_history and then truncates it to 10,000 lines. My .bash_history is 10,000 lines after all these years.

I renamed .bashrc, exited the shell, and started the shell again. My .bash_history got truncated to the default 500 lines. And Termius now had a 5 second delay. So I emptied .bash_history completely, tried Termius again and now I had no delays. I loaded my original 10,000 line .bash_history from backup, tried Termius again and now I had the 120 second delay again. I tried it a few more times and it works consistently.

So Termius is doing something with .bash_history. The longer the file, the slower it is to start. I'm a bit concerned about this. I keep thinking about security.

I detailed all this and emailed it Termius. Got a reply almost immediately. They had found the problem. They have a new feature in the new version of Termius, called autocomplete. They load the shell history into memory of the app. They had problems with this, but they have fixed it and are testing the fix now. A new version should come down the pipeline shortly.