Skip to content

Commit

Permalink
Removes images.sixel_cursor_conformance config option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Utkarsh-khambra committed Sep 20, 2022
1 parent aef7a5c commit 44c1fb4
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 31 deletions.
1 change: 1 addition & 0 deletions metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
<ul>
<li>Fixes a problem with oversized glyphs being wrongly cut off (#821).</li>
<li>Fixes vertical cursor movement for sixel graphics with only newlines (#822)</li>
<li>Removes `images.sixel_cursor_conformance` config option</li>
</ul>
</description>
</release>
Expand Down
1 change: 0 additions & 1 deletion src/contour/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,6 @@ void loadConfigFromFile(Config& _config, FileSystem::path const& _fileName)
}

tryLoadValue(usedKeys, doc, "images.sixel_scrolling", _config.sixelScrolling);
tryLoadValue(usedKeys, doc, "images.sixel_cursor_conformance", _config.sixelCursorConformance);
tryLoadValue(usedKeys, doc, "images.sixel_register_count", _config.maxImageColorRegisters);
tryLoadValue(usedKeys, doc, "images.max_width", _config.maxImageSize.width);
tryLoadValue(usedKeys, doc, "images.max_height", _config.maxImageSize.height);
Expand Down
1 change: 0 additions & 1 deletion src/contour/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ struct Config
std::shared_ptr<logstore::Sink> loggingSink;

bool sixelScrolling = true;
bool sixelCursorConformance = true;
terminal::ImageSize maxImageSize = {}; // default to runtime system screen size.
unsigned maxImageColorRegisters = 4096;

Expand Down
2 changes: 0 additions & 2 deletions src/contour/TerminalSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ TerminalSession::TerminalSession(unique_ptr<Pty> _pty, ContourGuiApp& _app):
config_.bypassMouseProtocolModifier, // TODO: you too
config_.maxImageSize,
config_.maxImageColorRegisters,
config_.sixelCursorConformance,
profile_.colors,
50.0,
config_.reflowOnResize,
Expand Down Expand Up @@ -1088,7 +1087,6 @@ void TerminalSession::configureTerminal()

SessionLog()("Setting terminal ID to {}.", profile_.terminalId);
terminal_.setTerminalId(profile_.terminalId);
terminal_.setSixelCursorConformance(config_.sixelCursorConformance);
terminal_.setMaxImageColorRegisters(config_.maxImageColorRegisters);
terminal_.setMaxImageSize(config_.maxImageSize);
terminal_.setMode(terminal::DECMode::NoSixelScrolling, !config_.sixelScrolling);
Expand Down
3 changes: 0 additions & 3 deletions src/contour/contour.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,6 @@ images:
sixel_scrolling: true
# Configures the maximum number of color registers available when rendering Sixel graphics.
sixel_register_count: 4096
# If enabled, the ANSI text cursor is placed at the position of the sixel graphics cursor after
# image rendering, otherwise (if disabled) the cursor is placed underneath the image.
sixel_cursor_conformance: true
# maximum width in pixels of an image to be accepted (0 defaults to system screen pixel width)
max_width: 0
# maximum height in pixels of an image to be accepted (0 defaults to system screen pixel height)
Expand Down
4 changes: 0 additions & 4 deletions src/terminal/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1598,9 +1598,6 @@ void Screen<Cell>::sixelImage(ImageSize _pixelSize, Image::Data&& _data)
alignmentPolicy,
resizePolicy,
autoScrollAtBottomMargin);

if (!_terminal.isModeEnabled(DECMode::SixelCursorNextToGraphic))
linefeed(topLeft.column);
}

template <typename Cell>
Expand Down Expand Up @@ -2186,7 +2183,6 @@ namespace impl
case 2026: return DECMode::BatchedRendering;
case 2027: return DECMode::Unicode;
case 2028: return DECMode::TextReflow;
case 8452: return DECMode::SixelCursorNextToGraphic;
}
return nullopt;
}
Expand Down
4 changes: 0 additions & 4 deletions src/terminal/Terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ Terminal::Terminal(unique_ptr<Pty> _pty,
Modifier _mouseProtocolBypassModifier,
ImageSize _maxImageSize,
unsigned _maxImageColorRegisters,
bool _sixelCursorConformance,
ColorPalette _colorPalette,
double _refreshRate,
bool _allowReflowOnResize,
Expand All @@ -121,7 +120,6 @@ Terminal::Terminal(unique_ptr<Pty> _pty,
_maxHistoryLineCount,
_maxImageSize,
_maxImageColorRegisters,
_sixelCursorConformance,
move(_colorPalette),
_allowReflowOnResize },
// clang-format on
Expand All @@ -148,7 +146,6 @@ Terminal::Terminal(unique_ptr<Pty> _pty,
setMode(DECMode::AutoWrap, true);
setMode(DECMode::Unicode, true);
setMode(DECMode::TextReflow, true);
setMode(DECMode::SixelCursorNextToGraphic, state_.sixelCursorConformance);
#endif
}

Expand Down Expand Up @@ -1505,7 +1502,6 @@ void Terminal::hardReset()
setMode(DECMode::AutoWrap, true);
setMode(DECMode::Unicode, true);
setMode(DECMode::TextReflow, state_.allowReflowOnResize);
setMode(DECMode::SixelCursorNextToGraphic, state_.sixelCursorConformance);

state_.primaryBuffer.reset();
state_.alternateBuffer.reset();
Expand Down
2 changes: 0 additions & 2 deletions src/terminal/Terminal.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ class Terminal
Modifier _mouseProtocolBypassModifier = Modifier::Shift,
ImageSize _maxImageSize = ImageSize { Width(800), Height(600) },
unsigned _maxImageColorRegisters = 256,
bool _sixelCursorConformance = true,
ColorPalette _colorPalette = {},
double _refreshRate = 30.0,
bool _allowReflowOnResize = true,
Expand All @@ -108,7 +107,6 @@ class Terminal
LineCount maxHistoryLineCount() const noexcept;

void setTerminalId(VTType _id) noexcept { state_.terminalId = _id; }
void setSixelCursorConformance(bool _value) noexcept { state_.sixelCursorConformance = _value; }

void setMaxImageSize(ImageSize size) noexcept { state_.maxImageSize = size; }

Expand Down
3 changes: 0 additions & 3 deletions src/terminal/TerminalState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ TerminalState::TerminalState(Terminal& _terminal,
LineCount _maxHistoryLineCount,
ImageSize _maxImageSize,
unsigned _maxImageColorRegisters,
bool _sixelCursorConformance,
ColorPalette _colorPalette,
bool _allowReflowOnResize):
terminal { _terminal },
Expand All @@ -42,7 +41,6 @@ TerminalState::TerminalState(Terminal& _terminal,
imagePool { [this](Image const* _image) {
terminal.discardImage(*_image);
} },
sixelCursorConformance { _sixelCursorConformance },
allowReflowOnResize { _allowReflowOnResize },
primaryBuffer { Grid<Cell>(_pageSize, _allowReflowOnResize, _maxHistoryLineCount) },
alternateBuffer { Grid<Cell>(_pageSize, false, LineCount(0)) },
Expand Down Expand Up @@ -115,7 +113,6 @@ std::string to_string(DECMode _mode)
case DECMode::BatchedRendering: return "BatchedRendering";
case DECMode::Unicode: return "Unicode";
case DECMode::TextReflow: return "TextReflow";
case DECMode::SixelCursorNextToGraphic: return "SixelCursorNextToGraphic";
}
return fmt::format("({})", static_cast<unsigned>(_mode));
}
Expand Down
3 changes: 0 additions & 3 deletions src/terminal/TerminalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ struct TerminalState
LineCount _maxHistoryLineCount,
ImageSize _maxImageSize,
unsigned _maxImageColorRegisters,
bool _sixelCursorConformance,
ColorPalette _colorPalette,
bool _allowReflowOnResize);

Expand Down Expand Up @@ -159,8 +158,6 @@ struct TerminalState
std::shared_ptr<SixelColorPalette> imageColorPalette;
ImagePool imagePool;

bool sixelCursorConformance = true;

std::vector<ColumnOffset> tabs;

bool allowReflowOnResize;
Expand Down
8 changes: 0 additions & 8 deletions src/terminal/primitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -709,12 +709,6 @@ enum class DECMode
// If this mode is set, the current line and any line below is allowed to reflow.
// Default: Enabled (if supported by terminal).
TextReflow = 2028,

// If enabled (default, as per spec), then the cursor is left next to the graphic,
// that is, the text cursor is placed at the position of the sixel cursor.
// If disabled otherwise, the cursor is placed below the image, as if CR LF was sent,
// which is how xterm behaves by default (sadly).
SixelCursorNextToGraphic = 8452,
// }}}
};

Expand Down Expand Up @@ -798,7 +792,6 @@ constexpr unsigned toDECModeNum(DECMode m)
case DECMode::BatchedRendering: return 2026;
case DECMode::Unicode: return 2027;
case DECMode::TextReflow: return 2028;
case DECMode::SixelCursorNextToGraphic: return 8452;
}
return static_cast<unsigned>(m);
}
Expand Down Expand Up @@ -842,7 +835,6 @@ constexpr bool isValidDECMode(unsigned int _mode) noexcept
case DECMode::BatchedRendering:
case DECMode::Unicode:
case DECMode::TextReflow:
case DECMode::SixelCursorNextToGraphic:
//.
return true;
}
Expand Down

0 comments on commit 44c1fb4

Please sign in to comment.