Skip to content

Commit

Permalink
Merge pull request #679 from contour-terminal/fix/cli
Browse files Browse the repository at this point in the history
Trying to fix CLI.
  • Loading branch information
christianparpart authored May 5, 2022
2 parents 95c8561 + f11e0e3 commit 259768a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions scripts/ci/Xvfb-contour-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ ldd `which contour`
LOG="config,pty,gui.session,gui.display,vt.renderer,font.locator"
#LOG="all"

CONTOUR_PREFIX=gdb --batch --command=./scripts/test.gdb --args

$CONTOUR_PREFIX \
contour terminal \
debug "$LOG" \
Expand Down
4 changes: 4 additions & 0 deletions src/contour/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@ TerminalProfile loadTerminalProfile(UsedKeys& _usedKeys,

if (auto colors = _profile["colors"]; colors) // {{{
{
_usedKeys.emplace(fmt::format("{}.{}.colors", _parentPath, _profileName));
auto const path = fmt::format("{}.{}.{}", _parentPath, _profileName, "colors");
if (colors.IsMap())
profile.colors = loadColorScheme(_usedKeys, path, colors);
Expand Down Expand Up @@ -1516,7 +1517,10 @@ TerminalProfile loadTerminalProfile(UsedKeys& _usedKeys,

if (optional<config::CursorConfig> cursorOpt =
parseCursorConfig(_profile["cursor"], _usedKeys, basePath + ".cursor"))
{
_usedKeys.emplace(basePath + ".cursor");
profile.inputModes.insert.cursor = cursorOpt.value();
}

if (auto normalModeNode = _profile["normal_mode"])
{
Expand Down
2 changes: 1 addition & 1 deletion src/contour/ContourGuiApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ crispy::cli::Command ContourGuiApp::parameterDefinition() const
#endif
CLI::Option {
CLI::OptionName { 'e', "execute" },
CLI::Value { "" },
CLI::Value { ""s },
"DEPRECATED: Program to execute instead of running the shell as configured.",
"PROGRAM",
CLI::Presence::Optional,
Expand Down
3 changes: 2 additions & 1 deletion src/contour/TerminalSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ void TerminalSession::bufferChanged(terminal::ScreenType _type)

void TerminalSession::screenUpdated()
{
if (profile_.autoScrollOnUpdate && terminal().viewport().scrolled() && terminal().inputHandler().mode() == ViMode::Insert)
if (profile_.autoScrollOnUpdate && terminal().viewport().scrolled()
&& terminal().inputHandler().mode() == ViMode::Insert)
terminal().viewport().scrollToBottom();

if (terminal().hasInput())
Expand Down
4 changes: 3 additions & 1 deletion src/crispy/CLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,8 @@ optional<FlagStore> parse(Command const& _command, int _argc, char const* const*
}

} // namespace crispy::cli
namespace crispy::cli // {{{ Help output

namespace crispy::cli
{

namespace // {{{ helpers
Expand Down Expand Up @@ -876,6 +877,7 @@ namespace // {{{ helpers
detailedDescription(_os, _command, _style, _margin, parents);
}
} // namespace
// }}}

HelpStyle::ColorMap HelpStyle::defaultColors()
{
Expand Down
2 changes: 2 additions & 0 deletions src/terminal/ViInputHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ namespace terminal
// [ ] motion %
// [ ] motion to jump marks up/down
// [ ] add timer to disable selection (needs timer API inside of libterminal)
// [ ] show cursor if it was hidden and restore it when going back to insert mode
// [ ] remember initial cursor shae and restore it when going back to insert mode

namespace
{
Expand Down

0 comments on commit 259768a

Please sign in to comment.