Contour - A modern C++ Terminal Emulator

Overview

Contour - A modern C++ Terminal Emulator

CI Build codecov C++17 Discord Twitch Live Stream

alt text

IMPORTANT: THIS PROJECT IS IN BETA STAGE & ACTIVE DEVELOPMENT

contour is a modern terminal emulator, for everyday use. It is aiming for power users with a modern feature mindset.

Features

  • โœ… Available on all 3 major platforms, Linux, OS/X, Windows (Windows is alpha stage).
  • โœ… GPU-accelerated rendering.
  • โœ… Font ligatures support (such as in Fira Code).
  • โœ… Unicode: Emoji support (-: ๐ŸŒˆ ๐Ÿ’ ๐Ÿ˜› ๐Ÿ‘ช - including ZWJ, VS15, VS16 emojis :-)
  • โœ… Unicode: Grapheme cluster support
  • โœ… Bold and italic fonts
  • โœ… High-DPI support.
  • โœ… Vertical Line Markers (quickly jump to markers in your history!)
  • โœ… Blurred behind transparent background when using Windows 10 or KDE window manager on Linux.
  • โœ… Runtime configuration reload
  • โœ… 256-color and Truecolor support
  • โœ… Key binding customization
  • โœ… Color Schemes
  • โœ… Profiles (grouped customization of: color scheme, login shell, and related behaviours)
  • โœ… Synchronized rendering (via DECSM 2026 / DECRM 2026)
  • โœ… Text reflow (configurable via DECSM 2027 / DECRM 2027)
  • โœ… Clickable hyperlinks via OSC 8
  • โœ… Clipboard setting via OSC 52
  • โœ… Sixel inline images
  • โœ… Terminal page buffer capture VT extension to quickly extract contents.

CLI - Command Line Interface

  Usage:

    contour [terminal] [config STRING] [profile STRING] [debug STRING] [live-config]
                       [working-directory STRING] [PROGRAM ARGS...]
    contour help
    contour version
    contour parser-table
    contour list-debug-tags
    contour capture [logical] [timeout FLOAT] [lines INT] output STRING

  Detailed description:

    contour [terminal]
        Spawns a new terminal application.

        Options:

            [config STRING]             Path to configuration file to load at startup.
                                        [default: /home/trapni/.config/contour/contour.yml]
            [profile STRING]            Terminal Profile to load.
            [debug STRING]              Enables debug logging, using a comma seperated list of tags.
            [live-config]               Enables live config reloading. [default: false]
            [working-directory STRING]  Sets initial working directory. [default: .]
            [PROGRAM ARGS...]           Executes given program instead of the configuration provided one.

Example Configuration File

[email protected]#$%^&*+=[]{}~?|โ”‚" default_profile: ubuntu_vm profiles: ubuntu_vm: shell: "ssh ubuntu-vm" terminal_size: columns: 130 lines: 30 environment: TERM: xterm-256color COLORTERM: truecolor font: size: 12 render_mode: lcd regular: "Fira Code" bold: "Fira Code:style=bold" italic: "Hack:style=italic" bold_italic: "Hack:style=bold italic" emoji: "emoji" tab_width: 8 history: limit: 8000 scroll_multiplier: 3 auto_scroll_on_update: true cursor: shape: block blinking: true background: opacity: 0.9 blur: false colors: google_dark color_schemes: google_dark: cursor: '#b0b030' selection: '#30c0c0' default: background: '#1d1f21' foreground: '#c5c8c6' normal: black: '#1d1f21' red: '#cc342b' green: '#198844' yellow: '#fba922' blue: '#3971ed' magenta: '#a36ac7' cyan: '#3971ed' white: '#c5c8c6' bright: black: '#969896' red: '#cc342b' green: '#198844' yellow: '#fba922' blue: '#3971ed' magenta: '#a36ac7' cyan: '#3971ed' white: '#ffffff' input_mapping: - { mods: [Alt], key: Enter, action: ToggleFullscreen } - { mods: [Control, Alt], key: S, action: ScreenshotVT } - { mods: [Control, Shift], key: Equal, action: IncreaseFontSize } - { mods: [Control, Shift], key: Minus, action: DecreaseFontSize } - { mods: [Control, Shift], key: N, action: NewTerminal } - { mods: [Control], mouse: WheelUp, action: IncreaseFontSize } - { mods: [Control], mouse: WheelDown, action: DecreaseFontSize } - { mods: [Alt], mouse: WheelUp, action: IncreaseOpacity } - { mods: [Alt], mouse: WheelDown, action: DecreaseOpacity } - { mods: [Control], key: '0', action: ResetFontSize } - { mods: [Shift], mouse: WheelUp, action: ScrollPageUp } - { mods: [Shift], mouse: WheelDown, action: ScrollPageDown } - { mods: [], mouse: WheelUp, action: ScrollUp } - { mods: [], mouse: WheelDown, action: ScrollDown } - { mods: [Shift], key: UpArrow, action: ScrollOneUp } - { mods: [Shift], key: DownArrow, action: ScrollOneDown } - { mods: [Shift], key: PageUp, action: ScrollPageUp } - { mods: [Shift], key: PageDown, action: ScrollPageDown } - { mods: [Shift], key: Home, action: ScrollToTop } - { mods: [Shift], key: End, action: ScrollToBottom } - { mods: [Alt, Shift], key: 'k', action: ScrollMarkUp } - { mods: [Alt, Shift], key: 'j', action: ScrollMarkDown } logging: file: "/path/to/contour.log" parse_errors: true invalid_output: true unsupported_output: true raw_input: false raw_output: false trace_input: false trace_output: false ">
word_delimiters: " /\\()\"'-.,:;<>[email protected]#$%^&*+=[]{}~?|โ”‚"
default_profile: ubuntu_vm
profiles:
    ubuntu_vm:
        shell: "ssh ubuntu-vm"
        terminal_size:
            columns: 130
            lines: 30
        environment:
            TERM: xterm-256color
            COLORTERM: truecolor
        font:
            size: 12
            render_mode: lcd
            regular: "Fira Code"
            bold: "Fira Code:style=bold"
            italic: "Hack:style=italic"
            bold_italic: "Hack:style=bold italic"
            emoji: "emoji"
        tab_width: 8
        history:
            limit: 8000
            scroll_multiplier: 3
            auto_scroll_on_update: true
        cursor:
            shape: block
            blinking: true
        background:
            opacity: 0.9
            blur: false
        colors: google_dark

color_schemes:
    google_dark:
        cursor: '#b0b030'
        selection: '#30c0c0'
        default:
            background: '#1d1f21'
            foreground: '#c5c8c6'
        normal:
            black:   '#1d1f21'
            red:     '#cc342b'
            green:   '#198844'
            yellow:  '#fba922'
            blue:    '#3971ed'
            magenta: '#a36ac7'
            cyan:    '#3971ed'
            white:   '#c5c8c6'
        bright:
            black:   '#969896'
            red:     '#cc342b'
            green:   '#198844'
            yellow:  '#fba922'
            blue:    '#3971ed'
            magenta: '#a36ac7'
            cyan:    '#3971ed'
            white:   '#ffffff'

input_mapping:
    - { mods: [Alt],            key: Enter,         action: ToggleFullscreen }
    - { mods: [Control, Alt],   key: S,             action: ScreenshotVT }
    - { mods: [Control, Shift], key: Equal,         action: IncreaseFontSize }
    - { mods: [Control, Shift], key: Minus,         action: DecreaseFontSize }
    - { mods: [Control, Shift], key: N,             action: NewTerminal }
    - { mods: [Control],        mouse: WheelUp,     action: IncreaseFontSize }
    - { mods: [Control],        mouse: WheelDown,   action: DecreaseFontSize }
    - { mods: [Alt],            mouse: WheelUp,     action: IncreaseOpacity }
    - { mods: [Alt],            mouse: WheelDown,   action: DecreaseOpacity }
    - { mods: [Control],        key: '0',           action: ResetFontSize }
    - { mods: [Shift],          mouse: WheelUp,     action: ScrollPageUp }
    - { mods: [Shift],          mouse: WheelDown,   action: ScrollPageDown }
    - { mods: [],               mouse: WheelUp,     action: ScrollUp }
    - { mods: [],               mouse: WheelDown,   action: ScrollDown }
    - { mods: [Shift],          key: UpArrow,       action: ScrollOneUp }
    - { mods: [Shift],          key: DownArrow,     action: ScrollOneDown }
    - { mods: [Shift],          key: PageUp,        action: ScrollPageUp }
    - { mods: [Shift],          key: PageDown,      action: ScrollPageDown }
    - { mods: [Shift],          key: Home,          action: ScrollToTop }
    - { mods: [Shift],          key: End,           action: ScrollToBottom }
    - { mods: [Alt, Shift],     key: 'k',           action: ScrollMarkUp }
    - { mods: [Alt, Shift],     key: 'j',           action: ScrollMarkDown }

logging:
    file: "/path/to/contour.log"
    parse_errors: true
    invalid_output: true
    unsupported_output: true
    raw_input: false
    raw_output: false
    trace_input: false
    trace_output: false

Installing from source

Prerequisites Linux

This is tested on Ubuntu 19.04, but any recent Linux with latest C++17 compiler should do:

sudo apt install \
    "g++-9" cmake pkg-config make libfreetype6-dev qtbase5-dev libqt5gui5 extra-cmake-modules \
    libfontconfig1-dev libharfbuzz-dev libfontconfig-dev

To enable blur-behind feature on transparent background, you'll need the following packages:

sudo apt install libkf5windowsystem-dev

And set pass -DCONTOUR_BLUR_PLATFORM_KWIN=ON to cmake when configuring the project.

In case you want to improve performance slightly and run at at least Linux, you can add -DLIBTERMINAL_EXECUTION_PAR=ON to the cmake configuration and make sure to have libtbb-dev installed beforehand.

Prerequisites Windows 10

For Windows, you must have Windows 10, 2018 Fall Creators Update, and Visual Studio 2019, installed. It will neither build nor run on any prior Windows OS, due to libterminal making use of ConPTY API.

vcpkg install freetype fontconfig harfbuzz qt5-base

Prerequisites Mac OS/X

brew install freetype fontconfig harfbuzz boost qt5

References

License

Contour - A modern C++ Terminal Emulator
-------------------------------------------

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Coredumps when drawing Unicode block characters

    Coredumps when drawing Unicode block characters

    Description

    When attempting to draw box drawing characters, contour attempts to free() an invalid pointer and dumps core.

    Environment

    • Contour Version or Git commit hash: 2814f42f705756cd2dbaeb8579618801c714c7fd
    • Operating System (name / distribution / version): Debian GNU/Linux 11
    • Contour configuration: None
    • TERM environment variable: xterm-256color
    • Compiler version: g++ 10.2.1

    Steps to Reproduce

    1. Install ugrep
    2. Try running ugrep 0..10FFFF which will show every assigned unicode character.
    3. Eventually, Contour will crash

    The point appears to be in the range of box drawing glyphs (U+2500) as I'm able to get it to coredump immediately when I type:

    ugrep box draw
    

    Update:

    This does not crash:

    ugrep 2500..70
    

    Nor does this:

    ugrep 2580..FF
    

    But this crashes:

    ugrep 2570..F
    
    bug VT: renderer fonts stability blocker 
    opened by hackerb9 34
  • XTSMGRAPHICS

    XTSMGRAPHICS "Read sixel graphics geometry" returns the different value from xterm.

    Contour Terminal version

    0.3.1-unreleased-master-7f13fbb0

    Installer source

    Github: source code cloned

    Operating System

    Ubuntu Linux 20.04

    Architecture

    x86-64

    Other Software

    No response

    Steps to reproduce

    cat <<EOF > test.sh
    IFS=';' read -a REPLY -s -t 0.25 -d "S" -p $'\e[?2;1;0S'
    echo "width=\${REPLY[2]} height=\${REPLY[3]}"
    EOF
    bash test.sh
    

    Expected Behavior

    Returned width and height are smaller than or equal to screen width and height (same as the latest xterm).

    Actual Behavior

    Returned width and height are always 1920 and 1080 regardless of screen size.

    Additional notes

    By this problem, https://github.com/hackerb9/lsix can not layout pictures as expected position.

    contour image

    xterm image

    ref: xterm implementation:

    https://github.com/ThomasDickey/xterm-snapshots/blob/834b501a1416d7f14b1c38705083f413aea92eee/charproc.c#L4625

    bug 
    opened by kumattau 31
  • segfault with with latest git

    segfault with with latest git

    Contour Terminal version

    latest git

    Installer source

    Github: source code cloned

    Operating System

    arch linux

    Architecture

    x86-64

    Other Software

    none

    Steps to reproduce

    build remove config start

    Expected Behavior

    contour starting

    Actual Behavior

    segment fault

    Additional notes

    https://termbin.com/m7r4 happens also with with stable

    bug frontend: OpenGL OpenGL blocker 
    opened by Glog78 23
  • Set some environment variable if shell is running inside Contour

    Set some environment variable if shell is running inside Contour

    Abstract

    I would like to have some environment variable automatically set by Contour, so the shells running inside may know they are running in Contour.

    When a shell is run inside Konsole, you get a few env vars to at least check their existence and be in the know:

    โ•ฐโ”€ env | grep KONSOLE
    KONSOLE_DBUS_SERVICE=:1.37
    KONSOLE_DBUS_SESSION=/Sessions/10
    KONSOLE_DBUS_WINDOW=/Windows/1
    KONSOLE_PROFILE_NAME=Default (ZSH)
    

    Motivation

    I am using the conceal feature in Vim. Conceal allows you to change keywords and sequences to a single letter. E.g. in C++, I am changing bool to ๐”น, true to โŠค and false to โŠฅ. This makes Vim show code when reading like below.

    Unfortunately, Konsole (KDE's terminal emulator I'm using normally) has issues with rendering Unicode. Note how the right-hand sidebar is wobbly, and how in the initialisation of the bool local variables, the โŠฅ just randomly went missing.

    Screenshot_20210217_131849

    So instead, I use a different glyph for the false keyword, โŸ‚. They might look similar, but they ain't. Even Wikipedia mentions the difference between the two symbols. While this makes the disappearing symbol issue fixed, it looks ugly...ish. Note the issue with this symbol is shown, but the wobbly is still there.

    Screenshot_20210217_132137

    If there was some environment variable set by Contour, I could write my Vim scripts in a way that they show the โŸ‚ glyph instead of โŠฅ when I'm in Konsole (or rather, disable this whole feature altogether because of the Unicode rendering issues of Konsole), and use the real โŠฅ symbol (and have the conceal feature enabled) when Contour is running.

    Specification

    I'm not sure what kind of env-var could be useful. But if there is "something" that starts with CONTOUR_ and I could grep for it similarly to KONSOLE_, it's already fine for scripting user-facing stuff.

    enhancement good first issue 
    opened by whisperity 23
  • No syntax highlighting in VIM

    No syntax highlighting in VIM

    After compiling under Gentoo I have no color in vim. The normal shell shows colors fine, but when I start vim, it only gives underscoring as highlighting. Is there a way to activate the color in VIM?

    opened by echo2go 21
  • SIGSEGV when displaying sixels

    SIGSEGV when displaying sixels

    Description

    When I run lsix to list the images in a directory, the first row of images appears and then Contour dumps core with a segfault.

    Environment

    • Contour Version or Git commit hash: Git main 77cb600f52f94d888cafe5282a64ad27d0494137
    • Operating System (name / distribution / version): Debian GNU/Linux 11 (bullseye) with Wayland
    • Contour configuration: unchanged
    • TERM environment variable: unchanged
    • Compiler version: g++ 10.2.1 [It didn't show while compiling, but g++ is what I have as my system default (/bin/c++ โ†’ /etc/alternatives/c++ โ†’ /usr/bin/g++)]

    Steps to Reproduce

    1. Run lsix in a directory with many images.
    2. The first row of images appears
    3. ๐Ÿ’ฅ(Kaboom)๐Ÿ’ฅ

    Debugging output

    Backtrace โ„– 1
    Thread 10 "contour" received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x7fffebe29700 (LWP 530418)]
    terminal::Grid::at (this=0x9b0740, _coord=...) at src/contour/src/terminal/Grid.h:794
    794             return (*next(lines_.begin(), unbox<int>(historyLineCount()) + _coord.row - 1))[static_cast<size_t>(_coord.column - 1)];
    (gdb) bt
    #0  terminal::Grid::at(terminal::Coordinate const&) (this=0x9b0740, _coord=...)
        at src/contour/src/terminal/Grid.h:794
    #1  0x00000000004fd0e9 in terminal::Screen::at(terminal::Coordinate const&) (_coord=..., this=
        0x9afd20) at src/contour/src/terminal/Screen.h:565
    #2  operator() (offset=..., __closure=<synthetic pointer>)
        at src/contour/src/terminal/Screen.cpp:2114
    #3  std::for_each<terminal::GridSize::iterator, terminal::Screen::renderImage(const std::shared_ptr<const terminal::Image>&, terminal::Coordinate, terminal::GridSize, terminal::Coordinate, terminal::ImageSize, terminal::ImageAlignment, terminal::ImageResize, bool)::<lambda(terminal::GridSize::Offset)> > (__last=..., __last=..., __f=..., __first=...) at /usr/include/c++/10/bits/stl_algo.h:3839
    #4  crispy::for_each<terminal::GridSize, terminal::Screen::renderImage(const std::shared_ptr<const terminal::Image>&, terminal::Coordinate, terminal::GridSize, terminal::Coordinate, terminal::ImageSize, terminal::ImageAlignment, terminal::ImageResize, bool)::<lambda(terminal::GridSize::Offset)> >
        (_fn=<optimized out>, _container=<optimized out>)
        at  src/contour/src/crispy/algorithm.h:55
    #5  terminal::Screen::renderImage(std::shared_ptr<terminal::Image const> const&, terminal::Coordinate, terminal::GridSize, terminal::Coordinate, crispy::ImageSize, terminal::ImageAlignment, terminal::ImageResize, bool)
        (this=<optimized out>, _imageRef=<optimized out>, _topLeft=..., _gridSize=..., _imageOffset=..., _imageSize=..., _alignmentPolicy=terminal::ImageAlignment::TopStart, _resizePolicy=terminal::ImageResize::NoResize, _autoScroll=true) at src/contour/src/terminal/Screen.cpp:2107
    #6  0x00000000004fd3ad in terminal::Screen::sixelImage(crispy::ImageSize, std::vector<unsigned char, std::allocator<unsigned char> >&&) (this=0x9afd20, _pixelSize=..., _data=<optimized out>)
        at src/contour/src/terminal/Screen.cpp:2060
    --Type <RET> for more, q to quit, c to continue without paging--c
    #7  0x000000000050b646 in terminal::Sequencer::unhook() (this=0x9b0590) at src/contour/src/terminal/Sequencer.cpp:1073
    #8  0x00000000004f68c9 in terminal::parser::Parser::processInput(char32_t) ([email protected]=0x9b0668, _ch=27 U'\033') at src/contour/src/terminal/Parser.h:796
    #9  0x00000000004f4bfc in terminal::parser::Parser::parseFragment(std::basic_string_view<char, std::char_traits<char> >) ([email protected]=0x9b0668, _data=Python Exception <class 'gdb.error'> value has been optimized out: 
    ) at src/contour/src/terminal/Parser.cpp:117
    #10 0x000000000050045e in terminal::Screen::write(std::basic_string_view<char, std::char_traits<char> >) ([email protected]=0x9afd20, _data="17!158?C#11!65?G#17!80?G!45?A#19!147?C$#17!334?_-#16!30~fv!20~z!12~rzz!15~}!38~vrNf!28~||k!53~|z!8~^!33~^!9~}!14~}!24~v|!23~^!13~|!14~v!51~}!21~|!28~|||!4~}!12~}!14~z{{!39~v!29~b!9~z!14~^!26~n!20~n}!4"...) at src/contour/src/terminal/Screen.cpp:528
    #11 0x0000000000518776 in terminal::Terminal::writeToScreen(std::basic_string_view<char, std::char_traits<char> >) (this=0x9afb40, _data="17!158?C#11!65?G#17!80?G!45?A#19!147?C$#17!334?_-#16!30~fv!20~z!12~rzz!15~}!38~vrNf!28~||k!53~|z!8~^!33~^!9~}!14~}!24~v|!23~^!13~|!14~v!51~}!21~|!28~|||!4~}!12~}!14~z{{!39~v!29~b!9~z!14~^!26~n!20~n}!4"...) at src/contour/src/terminal/Terminal.cpp:696
    #12 0x000000000051ae38 in terminal::Terminal::processInputOnce() (this=0x9afb40) at src/contour/src/terminal/Terminal.cpp:185
    #13 0x000000000051d2c0 in terminal::Terminal::mainLoop() (this=0x9afb40) at src/contour/src/terminal/Terminal.cpp:154
    #14 0x00007ffff686ced0 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #15 0x00007ffff7778ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
    #16 0x00007ffff6576def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
    (gdb)
    
    Backtrace โ„– 2
    Thread 10 "contour" received signal SIGSEGV, Segmentation fault.
    [Switching to Thread 0x7fffebe29700 (LWP 535751)]
    0x00000000004fd141 in terminal::ImageFragment::ImageFragment (this=<optimized out>) at /usr/include/c++/10/bits/shared_ptr_base.h:1190
    1190          __shared_ptr(__shared_ptr&& __r) noexcept
    (gdb) bt
    #0  0x00000000004fd141 in terminal::ImageFragment::ImageFragment(terminal::ImageFragment&&)
        (this=<optimized out>) at /usr/include/c++/10/bits/shared_ptr_base.h:1190
    #1  std::_Optional_base_impl<terminal::ImageFragment, std::_Optional_base<terminal::ImageFragment, false, false> >::_M_construct<terminal::ImageFragment>(terminal::ImageFragment&&)
        (this=<optimized out>) at /usr/include/c++/10/optional:419
    #2  std::optional<terminal::ImageFragment>::emplace<terminal::ImageFragment>(terminal::ImageFragment&&) (this=<optimized out>) at /usr/include/c++/10/optional:851
    #3  terminal::Cell::setImage(terminal::ImageFragment) (_imageFragment=..., this=<optimized out>)
        at src/contour/src/terminal/Grid.h:324
    #4  operator() (offset=..., __closure=<synthetic pointer>)
        at src/contour/src/terminal/Screen.cpp:2115
    #5  std::for_each<terminal::GridSize::iterator, terminal::Screen::renderImage(const std::shared_ptr<const terminal::Image>&, terminal::Coordinate, terminal::GridSize, terminal::Coordinate, terminal::ImageSize, terminal::ImageAlignment, terminal::ImageResize, bool)::<lambda(terminal::GridSize::Offset)> > (__last=..., __last=..., __f=..., __first=...) at /usr/include/c++/10/bits/stl_algo.h:3839
    #6  crispy::for_each<terminal::GridSize, terminal::Screen::renderImage(const std::shared_ptr<const terminal::Image>&, terminal::Coordinate, terminal::GridSize, terminal::Coordinate, terminal::ImageSize, terminal::ImageAlignment, terminal::ImageResize, bool)::<lambda(terminal::GridSize::Offset)> >
        (_fn=<optimized out>, _container=<optimized out>)
        at src/contour/src/crispy/algorithm.h:55
    #7  terminal::Screen::renderImage(std::shared_ptr<terminal::Image const> const&, terminal::Coordinate, terminal::GridSize, terminal::Coordinate, crispy::ImageSize, terminal::ImageAlignment, terminal::ImageResize, bool)
        (this=<optimized out>, _imageRef=<optimized out>, _topLeft=..., _gridSize=..., _imageOffset=..., --Type <RET> for more, q to quit, c to continue without paging--c
    _imageSize=..., _alignmentPolicy=terminal::ImageAlignment::TopStart, _resizePolicy=terminal::ImageResize::NoResize, _autoScroll=true) at src/contour/src/terminal/Screen.cpp:2107
    #8  0x00000000004fd3ad in terminal::Screen::sixelImage(crispy::ImageSize, std::vector<unsigned char, std::allocator<unsigned char> >&&) (this=0x9af260, _pixelSize=..., _data=<optimized out>) at src/contour/src/terminal/Screen.cpp:2060
    #9  0x000000000050b646 in terminal::Sequencer::unhook() (this=0x9afad0) at src/contour/src/terminal/Sequencer.cpp:1073
    #10 0x00000000004f68c9 in terminal::parser::Parser::processInput(char32_t) ([email protected]=0x9afba8, _ch=27 U'\033') at src/contour/src/terminal/Parser.h:796
    #11 0x00000000004f4bfc in terminal::parser::Parser::parseFragment(std::basic_string_view<char, std::char_traits<char> >) ([email protected]=0x9afba8, _data=Python Exception <class 'gdb.error'> value has been optimized out: 
    ) at src/contour/src/terminal/Parser.cpp:117
    #12 0x000000000050045e in terminal::Screen::write(std::basic_string_view<char, std::char_traits<char> >) ([email protected]=0x9af260, _data="5?A#162?O#163_$#175!54?G#161??C#171C#205!9?_#28?q???o!4?C$#205!54?S#210???G#47!11?K???G#164???G$#196!71?o!7?A$#210!71?C#89C!4?G$#167!72?A#204A!4?C-#14!45~!4{~!10{~{{__g{{{}{{~~{{vooo?oo!19~nNFN!545~^^"...) at src/contour/src/terminal/Screen.cpp:528
    #13 0x0000000000518776 in terminal::Terminal::writeToScreen(std::basic_string_view<char, std::char_traits<char> >) (this=0x9af080, _data="5?A#162?O#163_$#175!54?G#161??C#171C#205!9?_#28?q???o!4?C$#205!54?S#210???G#47!11?K???G#164???G$#196!71?o!7?A$#210!71?C#89C!4?G$#167!72?A#204A!4?C-#14!45~!4{~!10{~{{__g{{{}{{~~{{vooo?oo!19~nNFN!545~^^"...) at src/contour/src/terminal/Terminal.cpp:696
    #14 0x000000000051ae38 in terminal::Terminal::processInputOnce() (this=0x9af080) at src/contour/src/terminal/Terminal.cpp:185
    #15 0x000000000051d2c0 in terminal::Terminal::mainLoop() (this=0x9af080) at src/contour/src/terminal/Terminal.cpp:154
    #16 0x00007ffff686ced0 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
    #17 0x00007ffff7778ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
    #18 0x00007ffff6576def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
    (gdb) 
    
    bug VT: Backend stability 
    opened by hackerb9 19
  • Make deps of several C++ header libraries to improve terminal

    Make deps of several C++ header libraries to improve terminal

    Windows Terminal uses these C++ libraries: https://github.com/microsoft/terminal/tree/main/oss for a few things that include type-safety, thread-safety, safer math, performance, and easier implementation of some functionalities. Since this is a C++ terminal project, I thought I'd recommend these to improve things here. These libraries work on all platforms (Linux, Windows, MacOS).

    enhancement 
    opened by WSLUser 19
  • Chinese display has some problems

    Chinese display has some problems

    Contour Terminal version

    0.2.3

    Installer source

    GitHub: release page

    Operating System

    OS/X Monterey 12.0.1

    Architecture

    x86-64

    Other Software

    NeoVim 0.6.1

    Steps to reproduce

    display

    Expected Behavior

    image

    image

    Actual Behavior

    image

    image

    Additional notes

    bug fonts platform: osx 
    opened by Jackson-soft 18
  • empty window and

    empty window and "Precision qualifier" is not supported prior to GLSL version 1.30

    Description

    an empty window appears, the desktop background shines through can only be closed

    Environment

    ubuntu 20

    Steps to Reproduce

    > dpkg -i contour-terminfo_0.2.1~develop-2021-09-09-20-49-77cb600f-0ubuntu1~focal_amd64
    > dpkg -i contour_0.2.1~develop-2021-09-09-20-49-77cb600f-0ubuntu1~focal_amd64
    

    contour

    [error] Superfluous config key found: profiles.main.font.regular
    [error] Superfluous config key found: profiles.main.hyperlink_decoration.default
    qt5ct: using qt5ct plugin
    QOpenGLShader::compile(Vertex): Vertex shader failed to compile with the following errors:
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: error(#273) 5 compilation errors.  No code generated
    
    
    *** Problematic Vertex shader source code ***
    #line 1
    attribute highp vec3 vertexCoord;attribute highp vec2 textureCoord;varying highp vec2 uv;uniform highp mat4 vertexTransform;uniform highp mat3 textureTransform;void main() {   uv = (textureTransform * vec3(textureCoord,1.0)).xy;   gl_Position = vertexTransform * vec4(vertexCoord,1.0);}
    ***
    Could not link shader program:
     "Vertex shader failed to compile with the following errors:\nERROR: 1:1: error(#263) \"Precision qualifier\" is not supported prior to GLSL version 1.30\nERROR: 1:1: error(#263) \"Precision qualifier\" is not supported prior to GLSL version 1.30\nERROR: 1:1: error(#263) \"Precision qualifier\" is not supported prior to GLSL version 1.30\nERROR: 1:1: error(#263) \"Precision qualifier\" is not supported prior to GLSL version 1.30\nERROR: 1:1: error(#263) \"Precision qualifier\" is not supported prior to GLSL version 1.30\nERROR: error(#273) 5 compilation errors.  No code generated\n\n"
    QOpenGLShader::compile(Vertex): Vertex shader failed to compile with the following errors:
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: 1:1: error(#263) "Precision qualifier" is not supported prior to GLSL version 1.30
    ERROR: error(#273) 5 compilation errors.  No code generated
    

    the above error continues multiple times Sorry, no idea about any of this

    bug frontend: OpenGL stability 
    opened by dbpaul 17
  • Allow build on FreeBSD

    Allow build on FreeBSD

    These are some fixes for making contour compile on FreeBSD. Mostly things where Linux was assumed.

    Build with autogen.sh does not work because of the broken shebang (which I didn't bother fixing). Thus build manually with cmake:

    $ cmake -G'Unix Makefiles' -Bbuild .

    Everything seems fine so far, except changing the font. That causes a floating point exception. I may do some further debugging to try and figure out what is going on there.

    I don't know if the change in UnixPty.h:108 causes any trouble because of const correctness. The prototype of openpty on FreeBSD is :

     int
     openpty(int *amaster, int *aslave, char *name, struct termios *termp,
             struct winsize *winp);
    

    (see https://www.freebsd.org/cgi/man.cgi?query=openpty&apropos=0&sektion=0&manpath=FreeBSD+13.0-RELEASE+and+Ports&arch=default&format=html ). The compiler complains about the discarded const which causes the candidade to be disregarded.

    In case the changes get merged and the floating point exception fixed, I may bring contour to the FreeBSD Ports.

    VT: Backend 
    opened by herrhotzenplotz 16
  • Unicode character display (strangely wide or missing)

    Unicode character display (strangely wide or missing)

    Description

    Contour displays some characters very strangely or not at all.

    Environment

    • Contour Version or Git commit hash: 2814f42f705756cd2dbaeb8579618801c714c7fd
    • Operating System (name / distribution / version): Debian GNU/Linux 11
    • Contour configuration: None
    • TERM environment variable: xterm-256color
    • Compiler version: g++ 10.2.1

    Steps to Reproduce

    1. Run the fonttable script
    2. Notice that some of the characters are strangely large and most are missing. image
    3. Now run fonttable | less. Use the > key to go to the end of input.
    4. Notice that, although it should be identical, the glyphs now appear correct. image
    bug VT: renderer fonts blocker 
    opened by hackerb9 16
  • Handle case when config file is corrupted

    Handle case when config file is corrupted

    Description

    Describe your changes in detail

    Added exception handling on wrong read of provided config file
    by creation of valid configuration file and loading it
    

    Motivation and Context

    Why is this change required? What problem does it solve?

    Fixes #886

    How Has This Been Tested?

    • [x] Please describe how you tested your changes.
      • checked that on bad configure file contour will create new configure file and load it
    • [ ] see how your change affects other areas of the code, etc.

    Checklist:

    Go over all the following points, and put an x in all the boxes that apply.

    If you're unsure about any of these, don't hesitate to ask. We're here to help!

    • [x] I have read the CONTRIBUTING document in my spoken language, and understand the terms
    • [ ] I have updated (or added) the documentation accordingly.
    • [ ] I have added tests to cover my changes.
    • [x] I have gone through all the steps, and have thoroughly read the instructions
    frontend 
    opened by Yaraslaut 0
  • Wrong config file crashes contour

    Wrong config file crashes contour

    Contour Terminal version

    master a9742e

    Installer source

    Github: source code cloned

    Operating System

    Manjaro Linux

    Architecture

    x86-64

    Other Software

    No response

    Steps to reproduce

    Make config file unreadable by yaml As an example :

    • shell: "fish

    Expected Behavior

    loads default configuration with message about error in present configuration file

    Actual Behavior

    crashes

    Additional notes

    I noticed that TerminalSession have some error handling on configure loading while ContourGuiApp does not. Crash is happening here https://github.com/contour-terminal/contour/blob/a9742e99ec868d109d5df0e8934d385b2c151e89/src/contour/ContourGuiApp.cpp#L283

    bug 
    opened by Yaraslaut 0
  • Ubuntu 18.04 package links against GLIBCXX_3.4.26 which does not exist on 18.04

    Ubuntu 18.04 package links against GLIBCXX_3.4.26 which does not exist on 18.04

    Contour Terminal version

    0.3.7.245

    Installer source

    GitHub: release page

    Operating System

    Ubuntu 18.04.4 LTS

    Architecture

    x86-64

    Other Software

    No response

    Steps to reproduce

    • Download the Ubuntu 18.04 package from the Github release pages
    • Install with apt install ./contour*.deb
    • Run contour ./contour

    Expected Behavior

    Contour starts up properly

    Actual Behavior

    contour: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by contour)

    Then contour exits.

    Additional notes

    Ubuntu 18.04 does not ship this version of libstdc++. Contour should be rebuilt against an older version of libstdc++ for that Ubuntu version.

    See: https://github.com/LedgerHQ/ledger-live-desktop/issues/4016 for a similar issue

    bug 
    opened by delthas 6
  • Corrupted line width after resize

    Corrupted line width after resize

    Contour Terminal version

    Contour Terminal Emulator 0.3.7.245

    Installer source

    GitHub: release page

    Operating System

    Windows 11 21H2

    Architecture

    x86-64

    Other Software

    No response

    Steps to reproduce

    https://user-images.githubusercontent.com/44506630/202843332-882e5af9-18aa-4e49-9a1e-249334f4178a.mp4

    Expected Behavior

    Full width of the line available for editing

    Actual Behavior

    Line width is corrupter and not completele available for editing

    Additional notes

    No response

    bug VT: Backend 
    opened by Yaraslaut 4
  • VT extension: passive mouse reporting

    VT extension: passive mouse reporting

    The drafted spec is here: https://gist.github.com/christianparpart/bf82bc3a8ad7f3abeee3ada41c3178a9

    This adds support for allowing the terminal application to request mouse events, passively, i.e. the user can still select text as he'd be able to do when no app has requested mouse event tracking.

    This feature does make sense in situations where the shell (ZSH, fish, bash, ...) might want to implement:

    • reposition the cursor to where the mouse has been clicked in the command prompt
    • tooltips of the command the mouse cursor is currently hovering

    The problem without implementing such a VT extension is, that shells would never try to implement such features, as the user experience (no mouse-based select support) would be drained. Having this extension should be a win-win situation.

    @jerch, @lhecker, @dankamongmen do you see any major problem here? Would you guys be interested in something like this on your end, too?

    VT: Backend CMake 
    opened by christianparpart 2
  • [DRAFT] Add new ring type

    [DRAFT] Add new ring type

    Description

    Describe your changes in detail

    Added new ring type that gives more flexibility on inserting and erasing items 
    

    Motivation and Context

    On resize a lot of time spent on creating new ring and filling it with existing lines
    

    How Has This Been Tested?

    • [x] Please describe how you tested your changes.
      • Added unit tests
    • [ ] see how your change affects other areas of the code, etc.

    Checklist:

    Go over all the following points, and put an x in all the boxes that apply.

    If you're unsure about any of these, don't hesitate to ask. We're here to help!

    • [x] I have read the CONTRIBUTING document in my spoken language, and understand the terms
    • [ ] I have updated (or added) the documentation accordingly.
    • [x] I have added tests to cover my changes.
    • [ ] I have gone through all the steps, and have thoroughly read the instructions
    test 
    opened by Yaraslaut 0
Releases(v0.3.7.245)
Owner
Contour Terminal Emulator
Contour is a terminal emulator aiming at todays power users
Contour Terminal Emulator
Spitfire is a basic terminal language that can exicute code via the terminal.

Spitfire is a basic terminal language that can exicute code via the terminal. It is easy to learn and runs fast, considering that its just a 300 line c++ file.

jhomas tefferson 0 Nov 18, 2021
X terminal emulator rendering through OpenGL ES Compute Shaders

Zutty is a terminal emulator for the X Window System, functionally similar to several other X terminal emulators such as xterm, rxvt and countless others

Tom Szilagyi 251 Nov 21, 2022
Make your terminal emulator colorful!

libvterm Make your terminal emulator colorful! LibVTerm is an embeddable ANSI C89 (C90) library for parsing ANSI escape sequences. It is constructed i

Kirill GPRB 5 Jun 4, 2022
Small header only C++ library for writing multiplatform terminal applications

Terminal Terminal is small header only library for writing terminal applications. It works on Linux, macOS and Windows (in the native cmd.exe console)

Jupyter Xeus 251 Nov 18, 2022
:computer: C++ Functional Terminal User Interface. :heart:

FTXUI Functional Terminal (X) User interface A simple C++ library for terminal based user interface. Demo: Feature Functional style. Inspired by [1] a

Arthur Sonzogni 3.8k Nov 19, 2022
A little UNIX-inspired terminal application for the Numworks Calculator (not using escher).

L.E. Terminal (let for short) is a little UNIX-inspired terminal for the Numworks Calculator.

Cacahuรจte Sans Sel 20 Aug 31, 2022
Draw sequence diagram in text from terminal.

sequence-diagram-cli Draw seqence diagram from terminal.

null 43 Aug 4, 2022
Terminal calculator made for programmers working with multiple number representations, sizes, and overall close to the bits

Programmer calculator The programmer calculator is a simple terminal tool designed to give maximum efficiency and flexibility to the programmer workin

romes 173 Nov 19, 2022
The new Windows Terminal and the original Windows console host, all in the same place!

The new Windows Terminal and the original Windows console host, all in the same place!

Microsoft 86.1k Nov 18, 2022
nยณ The unorthodox terminal file manager

nยณ The unorthodox terminal file manager

Mischievous Meerkat 15.2k Nov 19, 2022
Graphs the activity of a chia harvester in a linux terminal.

Chia Harvest Graph Monitor for Chia Harvesting Introduction The chiaharvestgraph tool will graph Chia Harvesting activity in a linux terminal. Use a 2

Bram Stolk 216 Nov 10, 2022
a simple to use linux terminal

a simple to use linux terminal

notaweeb 7 Feb 17, 2022
Collection of human friendly terminal interface for git.

A collection of human friendly terminal user interface for git.

Arthur Sonzogni 73 Nov 25, 2022
Simple benchmark for terminal output

TermBench This is a simple timing utility you can use to see how slow your terminal program is at parsing escape-sequence-coded color output. It can b

Casey Muratori 176 Oct 19, 2022
tinytetris - 80x23 terminal tetris

tinytetris - 80x23 terminal tetris

Conor Taylor 2k Nov 22, 2022
A C, C++ and Rust library to draw graphics with pixels in the terminal

A library to draw graphics with pixels in the terminal Who needs a GUI when you have a terminal ? Building To generate libpluto.a, run: $ make To ins

null 69 Nov 7, 2022
๐Ÿ“บ๐Ÿ—ฟ Terminal graphics for the 21st century.

???? Chafa is a command-line utility that converts all kinds of images, including animated GIFs, into sixel or ANSI/Unicode character output that can be displayed in a terminal.

Hans Petter Jansson 1.8k Nov 15, 2022
Simple Unix Terminal Football Manager-like game.

Superleage 2020/2021 It is a "work in progress" simple game based on some mechanics of Football Manager. The game is in a very early stage of Developm

sewe2000 2 Oct 14, 2021
timg - Terminal Image and Video Viewer

timg - Terminal Image and Video Viewer

Henner Zeller 1.3k Nov 16, 2022