Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: contour-terminal/contour
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2153a75189ab96d80778e37cb3dadfa758078dfa
Choose a base ref
..
head repository: contour-terminal/contour
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1869695fc7e337f2d383ec2b1f4b3db76f57703c
Choose a head ref
Showing with 35 additions and 38 deletions.
  1. +4 −4 src/contour/Config.h
  2. +18 −20 src/contour/ConfigDocumentation.h
  3. +2 −4 src/contour/TerminalSession.cpp
  4. +4 −3 src/contour/display/TerminalDisplay.h
  5. +5 −4 src/contour/helper.cpp
  6. +2 −3 src/vtbackend/InputGenerator.h
8 changes: 4 additions & 4 deletions src/contour/Config.h
Original file line number Diff line number Diff line change
@@ -204,7 +204,9 @@ struct ConfigEntry
constexpr explicit ConfigEntry(T&& in): _value { std::forward<T>(in) } {}

template <typename F>
constexpr explicit ConfigEntry(F&& in): _value { std::forward<F>(in) } {}
constexpr explicit ConfigEntry(F&& in): _value { std::forward<F>(in) }
{
}
//clang-format on

[[nodiscard]] constexpr T const& value() const { return _value; }
@@ -767,9 +769,7 @@ struct YAMLConfigReader
}
}

void loadFromEntry(YAML::Node const& node,
std::string const& entry,
std::chrono::milliseconds& where)
void loadFromEntry(YAML::Node const& node, std::string const& entry, std::chrono::milliseconds& where)
{
if (auto const child = node[entry]; child)
where = std::chrono::milliseconds(child.as<int>());
38 changes: 18 additions & 20 deletions src/contour/ConfigDocumentation.h
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ namespace contour::config::documentation
template <std::size_t N>
struct StringLiteral
{
constexpr StringLiteral(const char (&str)[N]): value{} { std::copy_n(str, N, value); }
constexpr StringLiteral(const char (&str)[N]): value {} { std::copy_n(str, N, value); }

char value[N]; // NOLINT
};
@@ -422,28 +422,26 @@ constexpr StringLiteral Bell {
"\n"
};


constexpr StringLiteral FrozenDecMode {
"{comment} Defines a list of DEC modes to explicitly and permanently disable/enable support for.\n"
"{comment}\n"
"{comment} This is a developer-users-only option that may possibly help investigating problems.\n"
"{comment} This option may also be used by regular users if they're asked to in order to disable\n"
"{comment} a broken functionality. This is something we hardly try to avoid, of course.\n"
"{comment}\n"
"{comment} This can be an object with each key being the DEC mode number and its value a boolean,\n"
"{comment} indicating whether this DEC mode is permanently set (enabled) or unset (disabled).\n"
"{comment}\n"
"{comment} Example:\n"
"{comment}\n"
"{comment} frozen_dec_modes:\n"
"{comment} 2026: false\n"
"{comment} 2027: true\n"
"{comment}\n"
"{comment} Default: (empty object)\n"
"{comment}frozen_dec_modes:\n"
"{comment} Defines a list of DEC modes to explicitly and permanently disable/enable support for.\n"
"{comment}\n"
"{comment} This is a developer-users-only option that may possibly help investigating problems.\n"
"{comment} This option may also be used by regular users if they're asked to in order to disable\n"
"{comment} a broken functionality. This is something we hardly try to avoid, of course.\n"
"{comment}\n"
"{comment} This can be an object with each key being the DEC mode number and its value a boolean,\n"
"{comment} indicating whether this DEC mode is permanently set (enabled) or unset (disabled).\n"
"{comment}\n"
"{comment} Example:\n"
"{comment}\n"
"{comment} frozen_dec_modes:\n"
"{comment} 2026: false\n"
"{comment} 2027: true\n"
"{comment}\n"
"{comment} Default: (empty object)\n"
"{comment}frozen_dec_modes:\n"
};


constexpr StringLiteral Live {
"{comment} Determines whether the instance is reloading the configuration files "
"whenever it is changing or not. \n"
6 changes: 2 additions & 4 deletions src/contour/TerminalSession.cpp
Original file line number Diff line number Diff line change
@@ -194,8 +194,7 @@ TerminalSession::TerminalSession(unique_ptr<vtpty::Pty> pty, ContourGuiApp& app)
{
if (app.liveConfig())
{
sessionLog()("Enable live configuration reloading of file {}.",
_config.configFile.generic_string());
sessionLog()("Enable live configuration reloading of file {}.", _config.configFile.generic_string());
_configFileChangeWatcher = make_unique<QFileSystemWatcher>();
_configFileChangeWatcher->addPath(QString::fromStdString(_config.configFile.generic_string()));
connect(_configFileChangeWatcher.get(),
@@ -1409,8 +1408,7 @@ void TerminalSession::spawnNewTerminal(string const& profileName)
if (_config.spawnNewProcess.value())
{
sessionLog()("spawning new process");
::contour::spawnNewTerminal(
_app.programPath(), _config.configFile.generic_string(), profileName, wd);
::contour::spawnNewTerminal(_app.programPath(), _config.configFile.generic_string(), profileName, wd);
}
else
{
7 changes: 4 additions & 3 deletions src/contour/display/TerminalDisplay.h
Original file line number Diff line number Diff line change
@@ -223,9 +223,10 @@ class TerminalDisplay: public QQuickItem
// auto const availablePixels = gridMetrics().cellSize * _session->terminal().pageSize();
auto const availablePixels = vtbackend::ImageSize { vtbackend::Width::cast_from(width()),
vtbackend::Height::cast_from(height()) };
return pageSizeForPixels(availablePixels,
_renderer->gridMetrics().cellSize,
applyContentScale(_session->profile().margins.value(), _session->contentScale()));
return pageSizeForPixels(
availablePixels,
_renderer->gridMetrics().cellSize,
applyContentScale(_session->profile().margins.value(), _session->contentScale()));
}

void updateMinimumSize();
9 changes: 5 additions & 4 deletions src/contour/helper.cpp
Original file line number Diff line number Diff line change
@@ -621,10 +621,11 @@ void applyResize(vtbackend::ImageSize newPixelSize,
if (renderer.hasRenderTarget())
renderer.renderTarget().setRenderSize(newPixelSize);
renderer.setPageSize(newPageSize);
renderer.setMargin(computeMargin(renderer.gridMetrics().cellSize,
newPageSize,
newPixelSize,
applyContentScale(session.profile().margins.value(), session.contentScale())));
renderer.setMargin(
computeMargin(renderer.gridMetrics().cellSize,
newPageSize,
newPixelSize,
applyContentScale(session.profile().margins.value(), session.contentScale())));

if (oldPageSize.lines != newPageSize.lines)
emit session.lineCountChanged(newPageSize.lines.as<int>());
5 changes: 2 additions & 3 deletions src/vtbackend/InputGenerator.h
Original file line number Diff line number Diff line change
@@ -628,12 +628,11 @@ struct fmt::formatter<vtbackend::Modifier>: formatter<std::string_view>
}
};


template <>
struct fmt::formatter<vtbackend::InputGenerator::MouseWheelMode>: formatter<std::string_view>
{
auto format(vtbackend::InputGenerator::MouseWheelMode value, format_context& ctx)
-> format_context::iterator
auto format(vtbackend::InputGenerator::MouseWheelMode value,
format_context& ctx) -> format_context::iterator
{
string_view name;
switch (value)