Terminal

Post your Gambas programming questions here.
Post Reply
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Terminal

Post by cogier »

Using the Gambas Terminal the 'bash' history file is loaded so that pressing the [up arrow] gives you the previously used command. All the commands typed in the Terminal are also remembered. This is what you would expect. However once the Terminal is closed everything typed while it was open is lost. Can anybody tell me where the Gambas Terminal history is held while the Terminal is open.

I have checked this with gb.Terminal (Gambas Farm) it behaves as above. To test it just type something like:-

Code: Select all

echo  Mugabe is gone, great!
Press the [up arrow] and the command is there. Close and re open the Terminal and its gone!
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: Terminal

Post by stevedee »

cogier wrote: Friday 24th November 2017 4:49pm ...Can anybody tell me where the Gambas Terminal history is held while the Terminal is open...
I suspect its like MS Windows, were it is held in RAM, so not persistent.
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Terminal

Post by cogier »

My friend Matt found the issue. I had copied the gb.Terminal code that used TerminalView.kill to stop the Terminal in the Form_Close() routine. This was added as the TerminalView does not close when the Form is closed.

By setting up a Process pBash As Process the TerminalView will start with pBash = TerminalView1.Exec(["bash"]) and then close the Process cleanly with pBash.close and the .bash_history file will correctly update.

Thanks Matt. :D
Post Reply