Giter Club home page Giter Club logo

contour's Introduction

Contour - A modern C++ Terminal Emulator

Build Build codecov C++17

alt text

IMPORANT: THIS PROJECT IS IN ALPHA STAGE & ACTIVE DEVELOPMENT

Purpose

contour is a terminal emulator, for everyday use.

Features

  • Available on all 3 major platforms, Windows, Linux, OS/X.
  • Font Ligatures Support (such as in Fira Code).
  • GPU-accelerated rendering.
  • Blurred behind transparent background when using Windows 10 or KDE window manager on Linux.

Mission Statement

The following is an incomplete list of features that contour does or will support.

  • Available on all three major platforms (Linux, OS/X, Windows 10)
  • Runtime configuration reload
  • Font Ligatures Support (such as in Fira Code)
  • GPU-accelerated rendering
  • 256-color and Truecolor support
  • Key binding customization
  • Color Schemes
  • Profiles (grouped customization of: color scheme, login shell, and related behaviours)
  • Vertical Line Markers (quickly jump to markers in your history!)
  • Terminal Multiplexer Mode (like TMUX/screen) with a graphical as well as a text based frontend
  • History Search
  • Activity/Inactivity/Bell System Notification
  • Multiple Sessions, Windows, Tabs, Panes (like TMUX/screen)
  • Shell Integration (inspired by iTerm2)
  • Inline Images (inspired by iTerm2, conforming to their custom VT sequences for compatibility)

A word on vertical line markers

Suppose you type a lot in the terminal, and I bet you do. Some commands may have inconveniently long output and you need a way to conveniently scroll the terminal viewport up to the top of that command. This is what this feature is there for. You can easily walk up/down your markers like you'd walk up code folds or markers in VIM or other editors.

Set a mark:

echo -ne "\033[>M"

Example key bindings:

input_mapping:
    - { mods: [Alt, Shift], key: 'k', action: ScrollMarkUp }
    - { mods: [Alt, Shift], key: 'j', action: ScrollMarkDown }

It is recommended to integrate the marker into your command prompt, such as $PS1 in bash or sh to have automatic markers set.

CLI - Command Line Interface

Usage: contour [options]
Contour Terminal Emulator

Options:
  -h, --help            Displays this help.
  -v, --version         Displays version information.
  -c, --config <PATH>   Path to configuration file to load at startup
                        [~/.config/contour/conour.yml].
  -p, --profile <NAME>  Terminal Profile to load.

Example Configuration File

word_delimiters: " /\\()\"'-.,:;<>~!@#$%^&*+=[]{}~?|โ”‚"
default_profile: ubuntu_vm
profiles:
    ubuntu_vm:
        shell: "ssh ubuntu-vm"
        terminalSize:
            columns: 130
            lines: 30
        environment:
            TERM: xterm-256color
            COLORTERM: truecolor
        fontSize: 12
        fontFamily: "Fira Code, Hack, Cascadia Code, Ubuntu Mono, Consolas, monospace"
        tabWidth: 8
        history:
            limit: 8000
            scrollMultiplier: 3
            autoScrollOnUpdate: 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: [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"
    parseErrors: true
    invalidOutput: true
    unsupportedOutput: true
    rawInput: false
    rawOutput: false
    traceInput: false
    traceOutput: 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" libfreetype6-dev qtbase5-dev libqt5gui5 extra-cmake-modules \
    libfontconfig1-dev libharfbuzz-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 glew glfw3 glm harfbuzz qt5-base

Prerequisites Mac OS/X

brew install freetype fontconfig glew glfw3 glm harfbuzz boost qt5

References

contour's People

Contributors

christianparpart avatar swolter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.