D on Slashdot
ketmar via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jan 23 09:33:09 PST 2015
On Fri, 23 Jan 2015 12:50:31 +0000, Kagamin wrote:
> On Thursday, 22 January 2015 at 16:13:31 UTC, ketmar wrote:
>>> > somehow i can't close cmd.exe by hitting ctrl+c. don't console
>>> > programs know what ctrl+c is for?
>>> Well, maybe because it's a shell, not a utility?
>> shell is a console utility.
> Hmm... shell is a user interface providing access to the system and
> utilities. It's different from user utilities in that it's a system
> component, making the whole thing usable at all.
i can use my system without shell at all. it's in no way "system
component", nor even "critical system component". it's a simple
interpreter, which is not even necessary. a console utility.
> It shouldn't terminate
> conventionally, because then the user remains without access to the
> system
i ran sh in sh. how terminating second sh will leave me without access to
the system?
> that's why console shell doesn't terminate on ctrl-c and GUI
> shell doesn't terminate on alt-f4. But a text editor should definitely
> terminate in a conventional manner.
oh, how about "init=/usr/bin/vi"? look ma, vi is my shell now!
>> strangely, ctrl+c is not working in FAR too. it's not a shell. it's
>> obvious console.
>
> Maybe they just don't give a shit about it? Or they see it as a shell.
> Truth be told, FAR has a quit button at the bottom.
trush be told, vi has a quit command. i can't see why FAR is so different
from vi so it can ignore ctrl+c, and vi can't. just 'cause it's SPARTA^W
FAR?
> Well, that's your implementation. In fact shift-tab returns the previous
> entry. It's a popular reversal modifier, e.g. in a tabbed browser ctrl-t
> opens a new tab and ctrl-shift-t opens previously closed tab, in a text
> editor ctrl-z is "undo" and ctrl-shift-z is "redo".
it's good for windows-like systems that they appeared so late, so they
don't know what the hell those "terminals" was. hint: not every terminal
was able to distinguish between tab, shift+tab, ctrl+tab, etc. console
utility must remain usable on those things.
> The term has nothing to do with windows, it's from theory of programming
> languages, such things usually tend to be quite old, maybe even older
> than unix.
ok. it's string literal, as opposed to filename literal. string literals
are not subjects of autocompletion.
> Well, it's not really needed. User only types the first characters
> without quotes, no need for them really; then quotes are added by the
> autocompletion algorithm, if needed.
effectively turning filename literal to string literal and breaking
autocompletion. brilliant!
the reason why quoted strings can't be autocompleted is 'cause when you
start typing 'em, they are syntatically incorrect: they missing closing
quote. if you'll add closing quote, they *can't* be autocompleted, 'cause
they are already complete -- you indicated that with closing quote. there
is no sense in trying to do all that guesswork.
>>> As I explained, the file can start with a difficult to type character,
>>> requiring to type it is unnecessarily daunting.
>> and you know what? if you hit tab twice on empty line in bash, you'll
>> eventually see something like this:
>>
>> Display all 4788 possibilities? (y or n)
>>
>> good luck browsing thru that.
>
> On windows you can choose to iterate through some first of them or try
> something else. There are extreme cases, but they are, well, extreme.
> User folders are likely to have small number of files.
hitting tab in empty line must give you list of *ALL* possible commands.
cmd doesn't do that? then it's broken. yes, my system has 4788 commands
that i can invoke from command line.
and yes, typing "cat " and hitting tab twice will show you the list of
all files in the current directory.
and once again i must tell you about zsh, which has alot of nice UI
enhancements.
and sure, you can write custom autocompleters for bash and zsh, using
their shell language. there are many packages that allows to autocomplete
various arguments to various utilities, shows help when you need it, can
extract, show and complete arguments from 'configure' scripts and so on.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150123/3740ebd2/attachment-0001.sig>
More information about the Digitalmars-d
mailing list