Giter Site home page Giter Site logo

contour-terminal / contour Goto Github PK

View Code? Open in Web Editor NEW
2.2K 19.0 95.0 21.3 MB

Modern C++ Terminal Emulator

Home Page: http://contour-terminal.org/

License: Apache License 2.0

CMake 4.07% C++ 92.99% Shell 1.60% GLSL 0.42% Python 0.09% PowerShell 0.17% Objective-C++ 0.16% C 0.06% GDB 0.01% QML 0.43%
vte terminal-emulators library console xterm sixel-graphics unicode-support unicode linux emoji grapheme-cluster terminal hacktoberfest

contour's Introduction

Contour - a modern & actually fast Terminal Emulator

CI Build codecov C++20 Discord Twitch Live Stream open collective badge

screenshot showcasing notcurses ncneofetch on KDE/Fedora

contour is a modern and actually fast, modal, virtual terminal emulator, for everyday use. It is aiming for power users with a modern feature mindset.

Features

  • ✅ Available on all 4 major platforms, Linux, macOS, FreeBSD, Windows.
  • ✅ GPU-accelerated rendering.
  • ✅ Font ligatures support (such as in Fira Code).
  • ✅ Unicode: Emoji support (-: 🌈 💝 😛 👪 - including ZWJ, VS15, VS16 emoji :-)
  • ✅ Unicode: Grapheme cluster support
  • ✅ Bold and italic fonts
  • ✅ High-DPI support.
  • ✅ Vertical Line Markers (quickly jump to markers in your history!)
  • ✅ Vi-like input modes for improved selection and copy'n'paste experience and Vi-like scrolloff feature.
  • ✅ Blurred behind transparent background support for Windows 10 and above as well as the KDE and GNOME desktop environment on Linux.
  • ✅ Blurrable Background image support.
  • ✅ 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 SM ? 2026 / RM ? 2026)
  • ✅ Text reflow (configurable via SM ? 2028 / RM ? 2028)
  • ✅ Clickable hyperlinks via OSC 8
  • ✅ Clipboard setting via OSC 52
  • ✅ Sixel inline images
  • ✅ Terminal page buffer capture VT extension to quickly extract contents.
  • ✅ Builtin Fira Code inspired progress bar support.
  • ✅ Read-only mode, protecting against accidental user-input to the running application, such as Ctrl+C.
  • ✅ VT320 Host-programmable and Indicator status line support.
  • ✅ and much more ...

Installation

contour is packaged and available for installation on multiple distributions.

sudo dnf install contour-terminal

Installing via Flatpak

Install from Flathub

Click the following button to install Contour from the Flathub store.

Get it on Flathub

Prerequisites

Requirements

  • operating system: A recent operating system (macOS 12, Windows 10+, an up-to-date Linux, or FreeBSD)
  • GPU: driver must support at least OpenGL 3.3 hardware accelerated or as software rasterizer.
  • CPU: x86-64 AMD or Intel with AES-NI instruction set or ARMv8 with crypto extensions.

Configuration

In order to configure Contour, it is necessary to modify the configuration file contour.yml, which is initially generated in the $HOME/.config/contour directory. Some features also require shell integration. These can be generated via the CLI (see below), these currently exist for zsh, fish and tcsh.

Installing from source

Contour is best installed from supported package managers, but you can build from source by following the instructions below. You can use Qt 5 or Qt 6, by default contour will be compiled with Qt 6, to change Qt version use QTVER=5 ./scripts/install-deps.sh to fetch dependencies and cmake flag -D CONTOUR_QT_VERSION=5.

UNIX-like systems (Linux, FreeBSD, macOS)

Prerequisites

./scripts/install-deps.sh

This script might ask you for the administrator password if a package dependency can be insalled via the system package manager.

Compile

You can use cmake presets to compile contour. The full list of available presets can be seen using cmake --list-presets. To compile release build for linux or MacOs use linux-release or macos-release accordingly. FreeBSD users can use linux-release or configure cmake manually.

cmake --preset linux-release
cmake --build --preset linux-release

# Optionally, if you want to install from source
cmake --build --preset linux-release --target install

Windows 10 or newer

Prerequisites

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.

  1. Set up vcpkg, preferably somewhere high up in the folder hierarchy, and add the folder to your PATH.
cd C:\
git clone https://github.com/Microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
  1. Install Visual Studio Build Tools (make sure to select the CLI tools for C++, which you might need to do in the separate components tab).
  2. Install Qt6 (i.e. to C:\Qt)
  3. Open the developer version of Powershell.
  4. In the contour source folder execute .\scripts\install-deps.ps1. This step may take a very long time.

Compile

In the developer version of Powershell:

# change paths accordingly if you installed QT and vcpkg to somewhere else
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake -DCMAKE_PREFIX_PATH=C:\Qt\6.5.0\msvc2019_64\lib\cmake
cmake --build build/

# Optionally, if you want to install from source
cmake --build build/ --target install

Distribution Packages

Packaging status

CLI - Command Line Interface

  Usage:

    contour [terminal] [config FILE] [profile NAME] [debug TAGS] [live-config] [dump-state-at-exit PATH]
                       [early-exit-threshold UINT] [working-directory DIRECTORY] [class WM_CLASS]
                       [platform PLATFORM[:OPTIONS]] [session SESSION_ID] [PROGRAM ARGS...]
    contour font-locator [config FILE] [profile NAME] [debug TAGS]
    contour info vt
    contour help
    contour version
    contour license
    contour parser-table
    contour list-debug-tags
    contour generate terminfo to FILE
    contour generate config to FILE
    contour generate integration shell SHELL to FILE
    contour capture [logical] [words] [timeout SECONDS] [lines COUNT] to FILE
    contour set profile [to NAME]

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.

contour's People

Contributors

0x5c avatar 3n16m4 avatar andrew-stevenson-frequenz avatar anthony-geoghegan avatar christianparpart avatar cqexbesd avatar dankamongmen avatar data-man avatar elmarsan avatar ferdinandyb avatar gitabaz avatar goldsteine avatar herrhotzenplotz avatar jcelerier avatar jubnzv avatar marenz avatar ne02ptzero avatar ntbbloodbath avatar resubaka avatar saliaku avatar sebastianrakel avatar singalhimanshu avatar skyline75489 avatar swolter avatar topazus avatar uspasojevic96 avatar utkarsh-khambra avatar vnepogodin avatar whisperity avatar yaraslaut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

contour's Issues

CSI: Window Manipulation

CSI Ps ; Ps ; Ps t

See xterm docs; it's inherited from dtterm though.

Checklist:

  • 1: de-iconify window
  • 2: iconify window
  • 3; x; y : move window to position x, y
  • 4; height; width: resize window to given size in pixels
  • 5: raise window to the front
  • 6: lower window to the back
  • 7: refresh the window (aka. force redraw)
  • 8; height; width resize window to given size in character cell count
  • 9; 0: if window in fullscreen, then toggle back to windowed mode.
  • 9; 1: maximize window to full screen size.
  • 9; 2: maximize window vertically
  • 9; 3: maximize window horizontally
  • 10; 0: undo full screen mode
  • 10; 1: switch to full screen mode
  • 10; 2: toggle full screen mode
  • 11: report window state (iconified or not iconified)
  • 13: report window position
  • 14: Report xterm text area size in pixels.
  • 14; 2: Report xterm window size in pixels.
  • 15 : Report size of the screen in pixels.
  • 16 : Report xterm character cell size in pixels.
  • 18 : Report the size of the text area in characters.
  • 19 : Report the size of the screen in characters.
  • 20 : Report xterm window's icon label.
  • 21 : Report xterm window's title.
  • 22;0 -> Save xterm icon and window title on stack.
  • 22;1 -> Save xterm icon title on stack.
  • 22;2 -> Save xterm window title on stack.
  • 23;0 -> Restore xterm icon and window title from stack.
  • 23;1 -> Restore xterm icon title from stack.
  • 23;2 -> Restore xterm window title from stack.
  • >= 24 -> Resize to Ps lines (DECSLPP), VT340 and VT420.

example term inspired by ST and wlterm

I'd prefer using OpenGL/GLFW as it's most platform independent as opposed to X11/D2D/....

References:

These are graphical demo terminal emulators in not too many lines of code (5247 ST, 3013 wlterm).

See if we can create a purely minimal demo X11 term based libterminal.

Readiness Checklist:

  • Using Harfbuzz for rendering (ligatures must work, e.g. Fira Code)
  • Fallback font support
  • color palettes (providing default color palette with xterm colors)
  • Ctrl-SPACE must submit zero-byte
  • Hi-DPI font scaling works as expected
  • window resize
  • runtime text resize (CTRL+=, CTRL+-)
  • terminal cursor (shapes: block, underscore, beam; and blinking support)
  • visual bell
  • copy'n'paste
  • remember window size / font size (save instantly upon change)
  • yaml-cpp for config

DECSTR—Soft Terminal Reset

Implement: https://vt100.net/docs/vt510-rm/DECSTR.html

lists of terminal's default settings to reset to

  • | DECSTR | Text cursor enable | DECTCEM | Cursor enabled.
  • | Insert/replace | IRM | Replace mode.
  • | Origin | DECOM | Absolute (cursor origin at upper-left of screen.)
  • | Autowrap | DECAWM | No autowrap.
  • | National replacement character set | DECNRCM | Multinational set.
  • | Keyboard action | KAM | Unlocked.
  • | Numeric keypad | DECNKM | Numeric characters.
  • | Cursor keys | DECCKM | Normal (arrow keys).
  • | Set top and bottom margins | DECSTBM | Top margin = 1; bottom margin = page length.
  • | All character sets | G0, G1, G2, G3, GL, GR | Default settings.
  • | Select graphic rendition | SGR | Normal rendition.
  • | Select character attribute | DECSCA | Normal (erasable by DECSEL and DECSED).
  • | Save cursor state | DECSC | Home position.
  • | Assign user preference supplemental set | DECAUPSS | Set selected in Set-Up.
  • | Select active status display | DECSASD | Main display.
  • | Keyboard position mode | DECKPM | Character codes.
  • | Cursor direction | DECRLM | Reset (Left-to-right), regardless of NVR setting.
  • | PC Term mode | DECPCTERM | Always reset.

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.