Search found 967 matches

by jeb
17 Feb 2020 01:36
Forum: DOS Batch Forum
Topic: Bug in vt101 Alternate Screen Buffer?
Replies: 7
Views: 6139

Bug in vt101 Alternate Screen Buffer?

Hi, my win10 crashes reproducible by leaving the alternate screen buffer . :( The alternate screen could be useful for switching between different outputs or for games, because it doesn't support scrolling/scrollbars. My first crash sample, but only when I ask for user input. @echo off setlocal for ...
by jeb
17 Feb 2020 00:40
Forum: DOS Batch Forum
Topic: Query States using Console Virtual Terminal Sequences.
Replies: 12
Views: 8758

Re: Query States using Console Virtual Terminal Sequences.

Hi penpen, I think it can't be done using pure batch (or i haven't found a way yet). Yes, it can 8) @echo off for /F "delims=#" %%a in ('"prompt #$E# & for %%a in (1) do rem"') do set "ESC=%%a" call :get_cursor_pos pos exit /b :get_cursor_pos set "response=" set pos=2 :_get_loop <nul set /p "=%ESC%[...
by jeb
11 Feb 2020 11:31
Forum: DOS Batch Forum
Topic: The system cannot find the batch label specified
Replies: 1
Views: 3913

Re: The system cannot find the batch label specified

Hi James,

my best guess is that your line endings are LF-only.
Convert them to CR/LF and it should work !
Probably a side effect of your git commit rules, how to handle line endings (autocrlf).

jeb
by jeb
11 Feb 2020 11:20
Forum: DOS Batch Forum
Topic: Multi-line commands with leading spaces
Replies: 7
Views: 5589

Re: Multi-line commands with leading spaces

It's an effect of the multiline caret. A caret escapes the next character, if this character is a line feed THEN yet another character is fetched (but that's the last one even if it's a line feed, too) The character will always be escaped ( Here: ALWAYS is a synonym for mostly) Therefor something li...
by jeb
10 Feb 2020 07:37
Forum: DOS Batch Forum
Topic: Surprising difference between command line and batch
Replies: 7
Views: 5747

Re: Surprising difference between command line and batch

I believe that phase 2 isn't related to this effect. Proof by showing that phase 2 only detects one complete command token abc.bat @echo off echo This is "%~0" setlocal EnableDelayedExpansion echo ccl: "!cmdcmdline!" setlocal DisableDelayedExpansion prompt ###$G echo on REM # %0 # REM # %1 # @echo o...
by jeb
10 Feb 2020 02:22
Forum: DOS Batch Forum
Topic: Surprising difference between command line and batch
Replies: 7
Views: 5747

Re: Surprising difference between command line and batch

Very strange :shock: Especially penpen's test with a starting "+". "+" isn't a delimiter, but it is handled different than a letter :!: But "-" works like a letter :?: test "aaa^ b" -- fails test "^aaa^ b" -- fails test "^+aa^ b" --- works test "+aa^ b" --- works test "^-aa^ b" --- FAILS test "-aa^ ...
by jeb
10 Feb 2020 02:02
Forum: DOS Batch Forum
Topic: Multi-line commands with leading spaces
Replies: 7
Views: 5589

Re: Multi-line commands with leading spaces

And it's not special for the FOR command.

Code: Select all

IF 1==1 ^
    echo Hello - Fails
    
^
    echo Simple - Fails too
by jeb
05 Feb 2020 08:09
Forum: DOS Batch Forum
Topic: Copy name
Replies: 27
Views: 10698

Re: Copy name

Hi celsius,

is it possible that your command is bound to the context menu of the explorer?
And your command is stored in the registry?

I'm only guessing, but when "%~n2" doesn't expand, that's an obvious possibility.

jeb
by jeb
03 Feb 2020 13:25
Forum: DOS Batch Forum
Topic: Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect
Replies: 28
Views: 10041

Re: Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect

What the hell? Where is the relation between "<com" and chcp? "<com" /? Wechselt die aktuelle Codepage oder zeigt deren Nummer an. CHCP [nnn] nnn Die Nummer einer Codepage. Der Befehl CHCP ohne Parameter zeigt die Nummer der aktuellen Codepage an. But I hope this doesn't depends with the redirection...
by jeb
02 Feb 2020 15:48
Forum: DOS Batch Forum
Topic: Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect
Replies: 28
Views: 10041

Re: Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect

jeb wrote: ↑ Sun Feb 02, 2020 6:57 pm You triggered the "remove token" mechanism without a newline, I didn't know that this is possible, or at least I forget it :) My test #1 is simply a reformat of one of penpen's tests - who in turn claims he got it from you at viewtopic.php?p=32687#p32687. That'...
by jeb
02 Feb 2020 11:57
Forum: DOS Batch Forum
Topic: Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect
Replies: 28
Views: 10041

Re: Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect

Tests #2 and #3 result in a syntax error. But more importantly, the echo output has no line reorganization nor any file handle inserted before the redirection symbols. So adding a 3rd redirection causes all redirection parsing to fail entirely. I suppose, you tricked yourself. Your result looks str...
by jeb
30 Jan 2020 00:40
Forum: DOS Batch Forum
Topic: Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect
Replies: 28
Views: 10041

Re: Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect

Now if redirection is discovered, the parser could look backward in the original phase 1 output buffer to determine if the prior character is a digit (valid handle identifier). If it is a digit, then it may represent a file handle, in which case it must look at the character before that. If it sees...
by jeb
29 Jan 2020 15:32
Forum: DOS Batch Forum
Topic: Erroneous GOTO does not break FOR loops
Replies: 2
Views: 2354

Re: Erroneous GOTO does not break FOR loops

But a successful GOTO terminates FOR loops. This may have been "obvious" to others, but I had never thought to test what happens to FOR loops after an erroneous GOTO. But I thought that this is one of the key features :?: 1) A simple EXIT /B or even a goto :existantLabel WILL remove cached code :!:...
by jeb
29 Jan 2020 14:57
Forum: DOS Batch Forum
Topic: Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect
Replies: 28
Views: 10041

Bug/Mystery in the phase parsing rules 1.5 and 2 CR vs redirect

Hi, while building some magic macro methods I found a strange behavior: @echo off for /F "usebackq delims= " %%C in (`copy /z "%~f0" nul`) do set "$CR=%%C" set "PROMPT=$LPHASE3$G " echo on set ^"var1=BEGIN-%===%3>NUL END" set ^"var2=BEGIN-%$CR%3>NUL END" set var $ ./remoteExec.sh "phase_error_CR.bat...
by jeb
16 Jan 2020 07:17
Forum: DOS Batch Forum
Topic: Redirect text to a file (runas command result)
Replies: 13
Views: 3022

Re: Redirect text to a file (runas command result)

Well, runas.exe doesn't write it's output to the standard stream or error stream, so it can't be redirected that way. This can't be correct, I tested it with Win10 10.0.17134.1184 and I can redirect it without problems. And also with Win7 6.1.7601 the redirection works. In both cases the content of...