Skip to content

Commit

Permalink
configured default value for cliColorDepth
Browse files Browse the repository at this point in the history
  • Loading branch information
Damans227 committed Mar 13, 2022
1 parent ea76de4 commit 5b19dd5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions awscli/autoprompt/prompttoolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ def create_application(self):
# which can be used to configure different color schemes in aws cli. You can read more
# about it in the documentation linked below:
# https://python-prompt-toolkit.readthedocs.io/en/master/pages/advanced_topics/styling.html?highlight=classes#color-depths
cliColorPalette = {"black_and_white": ColorDepth.MONOCHROME, "ansi_colors": ColorDepth.ANSI_COLORS_ONLY,"256_colors": ColorDepth.DEFAULT, "true_colors": ColorDepth.TRUE_COLOR}
cliColorDepth = self._session.get_config_variable('color_palette')
cliColorDepth = {"black_and_white": ColorDepth.MONOCHROME, "ansi_colors": ColorDepth.ANSI_COLORS_ONLY,"256_colors": ColorDepth.DEFAULT, "true_colors": ColorDepth.TRUE_COLOR}
depthLevel = self._session.get_config_variable('color_palette')
depthLevel = depthLevel if depthLevel else "256_colors"
self._create_buffers()
input_buffer_container, doc_window, output_window = self._create_containers()
layout = self._factory.create_layout(
Expand All @@ -127,7 +128,7 @@ def create_application(self):
kb = kb_manager.keybindings
app = Application(layout=layout, key_bindings=kb, full_screen=False,
output=self._output, erase_when_done=True,
input=self._input, color_depth=cliColorPalette[cliColorDepth])
input=self._input, color_depth=cliColorDepth[depthLevel])
self._set_app_defaults(app)
return app

Expand Down

0 comments on commit 5b19dd5

Please sign in to comment.