Commit graph

26 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 06504ee4be
[CMD] Fix French translation. 2018-08-06 22:40:12 +02:00
Katayama Hirofumi MZ 706a1c5132 [CMD] "del /s directory" command doesn't show the directories or files names in the confirmation message (#680)
CORE-14059
2018-07-13 01:47:45 +02:00
Hermès Bélusca-Maïto a165999067
[CMD] Improve the situations when the console title can be changed.
- Introduce two small helpers to change and restore the console title.
- Console title can change even when internal commands are executed.
- Note that when commands are run from within batch files, title is unchanged.
- When "cmd.exe /c command" is run, the console title is unchanged; however
  when "cmd.exe /k command" is run, the console title changes.
2018-06-03 02:36:39 +02:00
Hermès Bélusca-Maïto 39af25024a
[CMD] Print a newline after the interactive 'pause' command message finishes to run. 2018-06-03 02:36:32 +02:00
Hermès Bélusca-Maïto ddd03a8973
[CMD] Use string-safe call to build the new console title (possibly truncated, we don't care), avoiding any buffer overflow. Caught by David Quintana. 2018-05-20 19:57:43 +02:00
Hermès Bélusca-Maïto 03c233bcd0
[CMD] Improve how the command prompt displays when one presses Ctrl-C/break after having pressed ENTER, or after a command has been run. 2018-04-29 00:57:16 +02:00
Hermès Bélusca-Maïto a3b36f8d3e
[CMD] Don't reset bCtrlBreak too early.
This allows to break commands such as:

C:\ReactOS\system32> for %f in (*.*) do dir

as one would expect: stop the currently running 'dir' and the 'for'.
"bCtrlBreak" doesn't need to be volatile too.
2018-04-29 00:53:49 +02:00
Hermès Bélusca-Maïto 6dd27bd467
[CMD] Use CheckCtrlBreak(). 2018-04-29 00:50:40 +02:00
James Woodcock 8b72fce3e1
[CMD] Use _T() rather than L to initialise TCHARS. 2018-04-28 22:16:59 +02:00
James Woodcock d7e71357dc
[CMD] Fix CTRL-C handling.
Using CTRL-C to cancel command line input would leave the prompt in
a state where the next command would be ignored.  For example:

dir<CTRL-C>
dir

would cause cmd.exe to ignore the second dir command.
2018-04-28 22:16:58 +02:00
James Woodcock 23de2099e0
[CMD] Don't pass CTRL-C to child processes.
CORE-11677

The standard Win32 Console Control Handler will give CTRL-C events to
processes spawned from cmd.exe. If cmd.exe calls GenerateConsolCtrlEvent()
then the child process will receive two CTRL-C events.
2018-04-28 22:16:50 +02:00
Eric Kohl 4916c4cfd5 [CMD] Correct the action on shorcut Ctrl-M
Patch by Jacob S. Preciado.

CORE-10142
2018-03-22 22:29:33 +01:00
Hermès Bélusca-Maïto f982d77b8a
[CONUTILS] Diverse improvements: start doxygenating and add some resource messsage helper functions.
- Start to doxygenate the library, focusing in great details on the
  functions of the "outstream" module.
- Add a K32LoadStringEx function that expands (K32)LoadString by
  allowing a LanguageId parameter to be able to load strings from other
  languages than the current one.
- Add "ConResMsg*" helper functions to be able to (format and) print
  message strings with inserts that come *NOT* from a message table (as
  usual) *BUT* from resource string tables.
  Will be helpful for CORE-14265 in particular.

[CMD] Fix the call to ConMsgPrintfV().
2018-02-02 00:41:54 +01:00
Erdem Ersoy ba3f074320 [TRANSLATIONS] Update the email address and add a note in the Turkish translation document (#271) 2018-01-07 22:09:42 +01:00
Markus Gothe e2e699118f Improve swedish translations and add new translations to swedish. 2017-12-25 11:31:22 +01:00
Hermès Bélusca-Maïto 49db8dc2a2
[CMD] Fix resource string (unrecognized escape sequence); addendum to 9a59558. 2017-12-07 22:08:54 +01:00
Hermès Bélusca-Maïto f79d268ea1
[CMD] Fix the del /s command, reported by Pablo De Napoli. CORE-10460
The command should delete files in the specified directory and all of its
sub-directories, using any file pattern specified.

For example, the command:

    del /S .\my_directory

should delete all the files inside my_directory and its sub-directories,
and as such should also detect that "my_directory" is indeed a directory,
while doing:

    del /S .\my_file

should of course detect that "my_file" is indeed a file pattern, and thus,
delete all "my_file" files from the current directory and its sub-directories.

The command:

    del /S some_directory\file_pattern

should delete "file_pattern" files from some_directory and its sub-directories.
2017-12-03 16:01:44 +01:00
Hermès Bélusca-Maïto 9a59558307
[CMD] Fix the presentation of some confirmation prompts. 2017-12-03 15:58:53 +01:00
Hermès Bélusca-Maïto 748c87202c
[CMD] Update the documentation of the FOR command. CORE-5806
- Also update & translate the french translation.
- Translators, please verify & update the translations!
2017-11-21 23:47:46 +01:00
Hermès Bélusca-Maïto 7bd33ac4df
[CMD] Addendum to 26ff2c8 and to r40474 / 8cf1106: Fix CMD process exit code.
As it appears, the process exit code of CMD /C is really the errorlevel,
and not the "command's return value".
2017-11-19 00:48:37 +01:00
Hermès Bélusca-Maïto 26ff2c8ef3
[CMD] Fix the errorlevel value set by the EXIT command, and when a batch file has run.
CORE-10495 CORE-13672

- Fix the behaviour of the EXIT command, where it set the last errorlevel
  value ONLY when it was called with the /b switch and otherwise kept the
  ambient one, instead of always using the value that the user specified
  on the command-line.

- When a batch file has terminated, make the Batch() helper returning the
  errorlevel value so that, when the batch file has been started with the
  CALL command, CALL can in turn set the correct errorlevel value.

Verified with respect to Windows' cmd.exe.
2017-11-18 23:52:50 +01:00
Hermès Bélusca-Maïto 24ed534474
[CMD] Code formatting only. 2017-11-18 23:52:50 +01:00
Hermès Bélusca-Maïto 56a19b1439
[CMD] ExecutePipeline() returns the last error level (set to process exit code).
CORE-13974

This should fix situations where (for example):
   command_1 | command_2 && echo Succeeded
should *NOT* run "echo Succeeded" if any of the command_1 or command_2 has
failed.

This also makes the ExecutePipeline() function on par with the other
"ExecuteXXX()" helpers.

Problem diagnosed by Doug Lyons; patch inspired by contributor 'cagey45'.
2017-11-18 20:59:06 +01:00
Hermès Bélusca-Maïto 8340574fe3
[CMD] Fix support for newlines in the emulated parenthesed set block of the "for" command.
CORE-7998
2017-11-17 00:58:45 +01:00
Hermès Bélusca-Maïto cfcca53856
[CMD] Fix '?' command output by adding a missing new-line. CORE-14016
Patch by Doug Lyons.
2017-11-16 21:27:27 +01:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00