Re: tab character in MSH ?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Alex K. Angelopoulos [MVP] wrote:
So there may be two separate issues here:
(1) Is it possible to make MSH differentiate between a pasted and a typed
character... and _should_ it?

It surely must be possible, but would probably require some custom hooks
into some low level input driver(s) or even to the bare metal(!). We
wrote some real mode asm once that directly manipulated the keyboard
buffer under DOS, but that would require substantial/complete rewriting
to work in windows

As for the second question: Bash under Linux suffers the same problem.
I don't think that proves that MSH shouldn't have this feature ever
but I think it does say that it's not an unexpected or uncommon issue.
It would be a neat and groundbreaking feature to have that differentiation.

I dare say that pasting code from a pre-written script is just not the
right thing to be doing. I often debug snippets of shell code by having
a separate script file with test as part of the name and I just have
that open at the same time as my script and put testing stuff in there.
Then, quick save and run that script file in an open command window.

(2) Is there a compelling reason to provide an alternative character for
completion?

Sure, prior art. :) using tweakUI/registry editing, one can change the
completion char in the normal shell.

Given infinite time and infinite resources, I would suggest that a
legitimate, common indentation character should not turn into a
quick-completion character when pasted, and also that people should be able
to use anything they want as the completion character in the MSH shell.

Tab is *very* commonly used as a completion character almost everywhere,
explorer/IE address bar, bash, ksh, mozilla, opera, firefox (even
optionally in cmd.exe since at least NT4 SP?). I would probably not use
MSH as an interactive shell if the default turned into something other
than tab.

Another possibility is to have some sort of filter driver in the general
cut/copy functionality of the OS that would do on-the-fly tab->space
conversion. Or better, perhaps the console subsystem would just do
on-the-fly tab->space conversion on paste Hmm, that would screw up my
vim editing sessions. In fact, I'm wondering if a shell extension could
possibly do any of that? It looks like cmd.exe functionality already
does in a way. I executed the following line of perl:

print "start\tend";

What I got when I copied and pasted the output was

start end
^^^
|
+---Three Space Chars

The output does respect an 8 char tab stop so there's not an even ratio
of tabs to spaces.

~Jason

--
.



Relevant Pages

  • Re: Passing tab char in command line
    ... I want to pass a tab character as a command line parameter. ... input to a program which is typically called a "shell". ...
    (comp.lang.java.programmer)
  • Re: Sed substitution of metacharacters in regex
    ... The tabulation character may not be printable, ... is a valid command. ... If you have troubles entering a <Tab> character in your shell, ...
    (comp.unix.shell)
  • Re: shell scripting with solaris, help.
    ... Note that it's always preferable to separate options from other ... Bourne shell), so, if you want the script to be interpreted by a ... shell that recognizes the same syntax as the sh of other Unices, ... you want the first character of the first line of the ...
    (comp.unix.solaris)
  • Re: Formatting index entries
    ... replace each space with a tab character ... Copy the whole cell ... use Edit>Replace to replace every tab with a space. ... you want to rip all the Index tags out of the main document. ...
    (microsoft.public.mac.office.word)
  • Re: Calculations Result Sometimes Displays 000, Sometimes 444
    ... > when I was addressing your mention of strange formatting options, ... the fill character for each tab was set to 4 on one of the ... added to a layout (not duplicate or copy / paste) will automatically ...
    (comp.databases.filemaker)