Terminal

Post Reply
User avatar
cogier
Site Admin
Posts: 138
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Terminal

Post by cogier » Friday 24th November 2017 4:49pm

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!

stevedee
Posts: 49
Joined: Monday 20th March 2017 6:06pm

Re: Terminal

Post by stevedee » Friday 24th November 2017 8:05pm

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: 138
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Terminal

Post by cogier » Saturday 25th November 2017 3:55pm

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

Who is online

Users browsing this forum: No registered users and 1 guest