Page 1 of 2

AmigaOS Shell issue (FE Update 1)

PostPosted: Mon Sep 04, 2017 11:46 am
by Amigo1
I'm starting a new topic on this issue:

I noticed the Key sequence "CTRL-J" does not work the way it is described on the wiki AmigaDOS_Understanding_the_Shell under the section "Command Line Editing and Control". The wiki it says:
Ctrl+J Adds a line feed.

That's the way it behaved since AmigaOS 1.3
But now since at least AmigaOS 4.1 Update 5 it behaves like
Ctrl+M Processes the command line (same as Return)


With the old console/shell you could enter more commands and execute them sequentially e.g.:
Code: Select all
date <CTRL-J>
echo "lha x ram:test.lha" <CTRL-J>
date <RETURN>


and the result would be

Code: Select all
Saturday 02-Sep-17 02:08:00
lha x ram:test.lha
Saturday 02-Sep-17 02:08:01


It behaves correctly under AmigaOS 4.1 update 1 on a Sam440.
AmigaOS 4.1 Update 5 has "CTRL-J" the same asl "CTRL-M" already.

Sometimes it is handy to use CTRL-J the way it was described in the AmigaOS 3.1 manual too. Maybe it can be brought back? 8-)

Re: AmigaOS Shell issue (FE Update 1)

PostPosted: Tue Sep 05, 2017 12:57 am
by tonyw
I wasn't aware that the behaviour had changed. I'll take this as a bug report, thanks.

Filed as BZ #9906 so that I don't forget it.

Re: AmigaOS Shell issue (FE Update 1)

PostPosted: Wed Sep 06, 2017 10:21 am
by Amigo1
tonyw wrote:I wasn't aware that the behaviour had changed. I'll take this as a bug report, thanks.

Filed as BZ #9906 so that I don't forget it.


Thank you! :)

Re: AmigaOS Shell issue (FE Update 1)

PostPosted: Wed Sep 06, 2017 1:00 pm
by tonyw
Trying to fix it now: getting the LF (Ctrl-J) to work without ending the command input is easy, but I'm having some trouble with the history handling (Up-arrow for previous command etc).

This part of the code was completely refactored and rewritten back in 2011 and works very differently now.

Re: AmigaOS Shell issue (FE Update 1)

PostPosted: Thu Sep 07, 2017 12:51 pm
by tonyw
I checked old versions and they had the same problem as I did in the latest version - you could enter several commands, separated by <NL>, but when you backed up through them using the Up-arrow, the multiple-line commands gave problems. Even the old 68K versions didn't work properly.

I've fixed it now so that a multi-line command is broken up into separate commands when stored in the History. So as you Up-arrow through them, you see each line in the multi-line command as a separate command.

Re: AmigaOS Shell issue (FE Update 1)

PostPosted: Thu Sep 07, 2017 3:12 pm
by Amigo1
tonyw wrote:I checked old versions and they had the same problem as I did in the latest version - you could enter several commands, separated by <NL>, but when you backed up through them using the Up-arrow, the multiple-line commands gave problems. Even the old 68K versions didn't work properly.

I've fixed it now so that a multi-line command is broken up into separate commands when stored in the History. So as you Up-arrow through them, you see each line in the multi-line command as a separate command.


Frankly, this is the solution I would have thought of as the best.
Thank you very, very much!! :-) :D 8-)

Re: AmigaOS Shell issue (FE Update 1)

PostPosted: Thu Sep 07, 2017 11:36 pm
by nbache
Nice work, Tony!

I assume it will be broken up the same way in the saved history file, if you enable that?

Best regards,

Niels

Re: AmigaOS Shell issue (FE Update 1)

PostPosted: Fri Sep 08, 2017 1:47 am
by tonyw
The "saved history file" comes from the console and is representative only of the display on the screen.

This "command input" format we are discussing is a con-handler thang and the console just displays what it is told. All the editing (previous history, erasing/inserting, etc) occurs in the con-handler.

I still have a problem - if you enter one or more commands separated by <NL> and then, instead of typing a new command, you Up-Arrow though the old history, I get the same formatting problems again.
Still working on a fix for that.

Re: AmigaOS Shell issue (FE Update 1)

PostPosted: Fri Sep 08, 2017 5:24 pm
by nbache
tonyw wrote:The "saved history file" comes from the console and is representative only of the display on the screen.
Right, so the saved history will just show that situation as:

prompt$ first_command
second_command
output from both
prompt$

- or what?

Best regards,

Niels

Re: AmigaOS Shell issue (FE Update 1)

PostPosted: Sun Feb 11, 2018 2:49 am
by tonyw
Sorry, Niels, didn't see your question.

Yes, that is the way it will appear on the screen and in the history saved from the console menu, but I am more concerned with what you will see when you type the "History" command (which does not show any of the prompts or program output).

I had forgotten about this bug and had not done anything on it since 30th September last year, but I just rechecked it and I think I must have put it aside as "fixed". Our only grand-daughter arrived that day, so that may explain my forgetting where I was up to !

The way it is now, you can type several commands separated by LFs, and they will be executed all at once. If you type "History", you will see the individual commands and you can Up-Arrow to get any one of them in turn.
The contentious part is this: what should happen if you say, type "aaa"<LF>"bbb"<LF>"ccc"<up-arrow> ? Well, the answer is that typing Up-Arrow at the end of a multiple command cancels the command completely.

I'll release it to the beta testers and see what they think.