Skip to content

Commit 5083a69

Browse files
committed
Merge from 3.x: PR #5635
Fixes #5495
2 parents afb0ef5 + 98df9e9 commit 5083a69

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

Diff for: bootstrap.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,15 @@
2828
usage="python bootstrap.py [options] [-- spyder_options]",
2929
epilog="""\
3030
Arguments for Spyder's main script are specified after the --
31-
symbol (example: `python bootstrap.py -- --show-console`).
31+
symbol (example: `python bootstrap.py -- --hide-console`).
3232
Type `python bootstrap.py -- --help` to read about Spyder
3333
options.""")
3434
parser.add_option('--gui', default=None,
3535
help="GUI toolkit: pyqt5 (for PyQt5), pyqt (for PyQt4) or "
3636
"pyside (for PySide, deprecated)")
37+
parser.add_option('--show-console', action='store_true', default=False,
38+
help="(Deprecated) Does nothing, now the default behavior "
39+
"is to show the console")
3740
parser.add_option('--hide-console', action='store_true',
3841
default=False, help="Hide parent console window (Windows only)")
3942
parser.add_option('--test', dest="test", action='store_true', default=False,
@@ -154,9 +157,13 @@
154157

155158
# --- Executing Spyder
156159

157-
if not options.hide_console and os.name == 'nt':
158-
print("0x. Enforcing parent console (Windows only)")
159-
sys.argv.append("--show-console") # Windows only: show parent console
160+
if options.show_console:
161+
print("(Deprecated) --show console does nothing, now the default behavior "
162+
"is to show the console, use --hide-console if you want to hide it")
163+
164+
if options.hide_console and os.name == 'nt':
165+
print("0x. Hiding parent console (Windows only)")
166+
sys.argv.append("--hide-console") # Windows only: show parent console
160167

161168
print("04. Running Spyder")
162169
from spyder.app import start

Diff for: doc/options.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Options:
1313
administrative privileges)
1414
-w WORKING_DIRECTORY, --workdir=WORKING_DIRECTORY
1515
Default working directory
16-
--show-console Do not hide parent console window (Windows)
16+
--hide-console Hide parent console window (Windows)
17+
--show-console (Deprecated) Does nothing, now the default behavior is to show the console
1718
--multithread Internal console is executed in another thread
1819
(separate from main application thread)
1920
--profile Profile mode (internal test, not related with Python

Diff for: spyder/app/cli_options.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ def get_options():
2626
"administrative privileges)")
2727
parser.add_option('-w', '--workdir', dest="working_directory", default=None,
2828
help="Default working directory")
29+
parser.add_option('--hide-console', action='store_true', default=False,
30+
help="Hide parent console window (Windows)")
2931
parser.add_option('--show-console', action='store_true', default=False,
30-
help="Do not hide parent console window (Windows)")
32+
help="(Deprecated) Does nothing, now the default behavior "
33+
"is to show the console")
3134
parser.add_option('--multithread', dest="multithreaded",
3235
action='store_true', default=False,
3336
help="Internal console is executed in another thread "

Diff for: spyder/app/mainwindow.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -3039,8 +3039,13 @@ def main():
30393039
# otherwise, optparse won't be able to exit if --help option is passed
30403040
options, args = get_options()
30413041

3042+
if options.show_console:
3043+
print("(Deprecated) --show console does nothing, now the default "
3044+
" behavior is to show the console, use --hide-console if you "
3045+
"want to hide it")
3046+
30423047
if set_attached_console_visible is not None:
3043-
set_attached_console_visible(options.show_console
3048+
set_attached_console_visible(not options.hide_console
30443049
or options.reset_config_files
30453050
or options.reset_to_defaults
30463051
or options.optimize or bool(DEBUG))

0 commit comments

Comments
 (0)