Questions tagged [windows-console]

Windows character mode applications using the functions provided by the console I/O functions. This tag should be used by questions about the console functions, structures and winevents, which support character mode applications.

614 questions
7
votes
4 answers

Why ANSI Code-Page and Console Code-Page are different?

Microsoft Windows provides several functions to query the current code-page: GetACP, GetConsoleOutputCP, GetConsoleCP. They return different values. For example, on my machine, GetACP returns 1252 while GetConsoleOutputCP and GetConsoleCP return…
Amir Gonnen
  • 3,525
  • 4
  • 32
  • 61
7
votes
3 answers

python 2.7 character \u2013

I have following code: # -*- coding: utf-8 -*- print u"William Burges (1827–81) was an English architect and designer." When I try to run it from cmd. I get following message: Traceback (most recent call last): File "C:\Python27\utf8.py", line…
user2904150
  • 149
  • 1
  • 1
  • 9
7
votes
1 answer

Suppress output for windows move command

Here is simple move command that moves all the text files to the folder TextFiles Move *.txt TextFiles I am getting outputs like the file was moved. I am going to use this command in a batch file. Any way to suppress showing the user that a file…
lostpacket
  • 1,383
  • 8
  • 26
  • 38
6
votes
3 answers

How to read very long input from console in C#?

I need to load veeeery long line from console in C#, up to 65000 chars. Console.ReadLine itself has a limit of 254 chars(+2 for escape sequences), but I can use this: static string ReadLine() { Stream inputStream =…
Dragoon Aethis
  • 169
  • 3
  • 11
6
votes
1 answer

How to ask for password on the Windows console in a Perl script?

I tried the following code use strict; use warnings; use Term::ReadPassword::Win32 qw(read_password); my $pw = read_password('pw: '); print "pw $pw\n"; my $x = ; print "x: $x\n"; It indeed asks for a password and does not echo the answer…
szabgab
  • 6,202
  • 11
  • 50
  • 64
6
votes
2 answers

Colorize stdout output to Windows cmd.exe from console C++ app

I would like to write something similar to cout << "this text is not colorized\n"; setForeground(Color::Red); cout << "this text shows as red\n"; setForeground(Color::Blue); cout << "this text shows as blue\n"; for a C++ console program running…
tucuxi
  • 17,561
  • 2
  • 43
  • 74
6
votes
1 answer

I'm trying to "fork off" a background process in Go -- works perfectly on Mac and Linux, but dies when terminal is closed on Windows

Consider this trivial Go program, which demonstrates the standard way to "fork off" a background process in Go. When it's run, it should immediately send itself to the background where it will write incrementing integers to output.txt once per…
Sergey
  • 99
  • 6
6
votes
2 answers

In git bash how to increase less's screen width?

I am using git bash 2.32 on Windows 10. In git bash after updating to 2.32 I see strange behavior of the command I used for displaying log: git -c core.pager='less -S -F' log --all --decorate --oneline --graph As you can see I try to use "a dog"…
daniel.kish
  • 95
  • 1
  • 10
6
votes
1 answer

How to apply coloring/formatting to the displayed text in input()-function (similar to print statement formatting)?

I have a small game application, which is started from the Windows console (cmd.exe). I am able to format the text in any desired way using ANSI escape sequences. I would also love to apply formatting to the text from the input()-method, but I have…
Cut7er
  • 1,209
  • 9
  • 24
6
votes
1 answer

Changing the position of the console window with Python (Windows)

Is it possible to change the position of the Windows console through python? If not, is there any workaround? I don't know if you would need any specific information, but just in case: I'm using Windows 8.1 (64x), Python 3.5.0, the console is being…
ArsonFG
  • 315
  • 8
  • 22
6
votes
3 answers

Python console Fullscreen? Maybe using os.system?

I'm trying to figure out how to get my program to open in a fullscreen console window. Is there any command that you can type within the command prompt to toggle fullscreen? If so I'd imagine the code going something like: from os import…
Alex Rosenbach
  • 75
  • 1
  • 1
  • 7
6
votes
1 answer

Windows Python interpreter exits on Ctrl+C

With most Python interpreters that I've used, Ctrl+C will cause the interpreter to print out "KeyboardInterrupt" and remain open. However, in a recent install on a new computer, Ctrl+C is causing the interpreter to exit, which is…
ita
  • 762
  • 5
  • 9
6
votes
2 answers

In Rust, how can I capture process output with colors?

I would like to capture output from another process (for example git status), process it, and print with all styles (bold, italics, underscore) and colors. It's very important for me to further process that String, I don't want only to print it. In…
Wojciech Polak
  • 101
  • 2
  • 7
6
votes
2 answers

How to find and delete a file with CMD command?

I know the filename, say myfile.pdf. But I do not know its location because my web application created it temporarily. When the user disconnect from the application then I want this file to be deleted. So how to search and delete the file?
pheromix
  • 18,213
  • 29
  • 88
  • 158
6
votes
1 answer

Why does PowerShell 5 from Windows 7 not have the same features as Windows 10?

I upgraded my PowerShell from 4.0 to 5.0 (Feb. 2016 release) on my Windows 7 SP1 machine. The $PSVersionTable shows PowerShell 5.0, but the shell does not have the same features as PowerShell 5.0 in Windows 10. Differences: Keyword…
Paebbels
  • 15,573
  • 13
  • 70
  • 139