UNIX and Linux terminals allow text input even when the currently running p= >rogram is still outputing text. For example, inside certain applications, s= >uch as "perl -d", where you send many lines of "print 'a';", or in Oracle's=
sqlplus or MySQL's mysql, where you send many "select 1 from dual;", the i=
nput and output are garbled. Some programs do a better job, such as bash, p= >ython.
So we know UNIX terminals are designed this way, so users can see what they=
type immediately. But it would be nice to give users an option. Windows co=
mmand console strictly serializes input and output based on the time of the=
input and output. It doesn't suit all needs but is the effect sometimes I =
want when using UNIX/Linux. None of the discussions I read mentions modern = >terminal capabilities that might offer some help. Note: this is not about t= >urning off local echo. Lowering baud rate with stty has no effect either.
While not directly related to a discussion about terminals, since some prog= >rams (bash, python) do a better job, how do they achieve that?
While not directly related to a discussion about terminals, since some prog= >rams (bash, python) do a better job, how do they achieve that?
In what way do they do a better job? They're just using cooked mode like everything else.
In case I was not clear, suppose you copy these lines
date
date
date
and paste them all at once to bash. The terminal screen will neatly show on= >e line of shell prompt and the "date" command, followed by the result of th= >e command (date and time) on the next line, and prompt plus commnad, and co= >mmand result, ... one line at a time.
But if you copy all these lines
print 'X';
print 'X';
print 'X';
and paste them all at once to the Perl debugging shell given by "perl -d" f= >ollowed by ^D, i.e. at the __DB<1> prompt, the lines you pasted will be mix= >ed with the 3 lines of 'X' character.
I hope there's a way to set some terminal option so that each "print 'X';" = >line is clearly printed *before* the X character it prints. If you have Per= >l installed on your Windows box, do the same. You'll get
No... Unix was not designed with the intention that people were going to paste big blocks of text into a terminal. Put it in a script, run the script.
UNIX and Linux terminals allow text input even when the currently
running program is still outputing text. For example, inside certain applications, such as "perl -d", where you send many lines of "print
'a';", or in Oracle's sqlplus or MySQL's mysql, where you send many
"select 1 from dual;", the input and output are garbled. Some programs
do a better job, such as bash, python.
at a time.While not directly related to a discussion about terminals, since some prog=
rams (bash, python) do a better job, how do they achieve that?
In what way do they do a better job? They're just using cooked mode like
everything else.
In case I was not clear, suppose you copy these lines
date
date
date
and paste them all at once to bash. The terminal screen will neatly show one line of shell prompt and the "date" command, followed by the result of the command (date and time) on the next line, and prompt plus commnad, and command result, ... one line
But if you copy all these lines
print 'X';
print 'X';
print 'X';
and paste them all at once to the Perl debugging shell given by "perl -d" followed by ^D, i.e. at the __DB<1> prompt, the lines you pasted will be mixed with the 3 lines of 'X' character.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 56:26:35 |
Calls: | 6,652 |
Calls today: | 4 |
Files: | 12,200 |
Messages: | 5,330,869 |