Skip to content

Instantly share code, notes, and snippets.

View christianparpart's full-sized avatar
🎃
Loading

Christian Parpart christianparpart

🎃
Loading
View GitHub Profile
@christianparpart
christianparpart / terminal-synchronized-output.md
Last active May 4, 2024 01:00
Terminal Spec: Synchronized Output

Synchronized Output

Synchronized output is merely implementing the feature as inspired by iTerm2 synchronized output, except that it's not using the rare DCS but rather the well known SM ? and RM ?. iTerm2 has now also adopted to use the new syntax instead of using DCS.

Semantics

When rendering the screen of the terminal, the Emulator usually iterates through each visible grid cell and renders its current state. With applications updating the screen a at higher frequency this can cause tearing.

This mode attempts to mitigate that.

@christianparpart
christianparpart / vt-spec-passive-mouse-tracking.md
Last active January 21, 2024 20:24
Terminal Spec: Passive Mouse Tracking

Passive Mouse Tracking

Motivation

While mouse event tracking is already possible in various modes and encodings, this feature seems most used by alt-screen applications however.

The reason why primary screen applications (such as your shell) usually don't make use of the mouse, is the design problem, that whenever the application is requesting mouse tracking events, the user cannot use the mouse to select text on the screen anymore.

With this VT extension, a new mode is introduced to inform the terminal that the user may still use the mouse to select text, but still have mouse events being reported to the application to allow passive tracking of mouse events.

@christianparpart
christianparpart / monkeypatchor.cpp
Created May 24, 2012 18:06
Monkey-Patching in C/C++ :-)
// compile me: g++ -shared -fPIC -ldl -o monkeypatchor.so monkeypatchor.cpp
// use me: LD_PRELOAD=`pwd`/monkeypatchor.so /bin/ls
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
void* (*malloc_super)(size_t);
void (*free_super)(void*);
@christianparpart
christianparpart / clang-error.txt
Created February 1, 2023 19:20
I'm not giving up on compiler oopses :)
0. Program arguments: /home/christianparpart/usr/opt/clang+llvm-15.0.2-aarch64-linux-gnu/bin/clang++ -Og -g -fdiagnostics-color=always -Qunused-arguments -Wall -Wduplicate-enum -Wextra -Wextra-semi -Wfinal-dtor-non-final-class -Wimplicit-fallthrough -Wmissing-declarations -Wnewline-eof -Wno-unknown-attributes -Wno-unknown-pragmas -Wnull-dereference -Wpessimizing-move -Wredundant-move -Wsuggest-destructor-override -pedantic -Wno-error=c++20-extensions -Wno-c++20-extensions -Wno-error=missing-declarations -Wno-missing-declarations -march=armv8-a+fp+simd+crypto+crc -std=c++20 -Werror -DBOOST_STACKTRACE_USE_ADDR2LINE=1 -DCONTOUR_STACKTRACE_ADDR2LINE=1 -DFMT_HEADER_ONLY=1 -DHAVE_BACKTRACE -DHAVE_BACKTRACE_SYMBOLS -DHAVE_CXXABI_H -DHAVE_DLADDR -DHAVE_DLFCN_H -DHAVE_DLSYM -DHAVE_EXECINFO_H -DHAVE_SYS_SELECT_H -DHAVE_UNWIND_H -DLIBTERMINAL_LOG_TRACE=1 -DLIBTERMINAL_NAME=\"contour\" -DLIBTERMINAL_VERSION_MAJOR=0 -DLIBTERMINAL_VERSION_MINOR=3 -DLIBTERMINAL_VERSION_PATCH=11 -DLIBTERMINAL_VERSION_STRING=\"0.3.11-cla
@christianparpart
christianparpart / tmux.conf
Created March 13, 2012 08:59
tmux configuration file for VIM- and ex-screen users
unbind C-b
set -g prefix ^A
bind a send-prefix
unbind A
bind A command-prompt "rename-window %%"
unbind ^A
bind ^A last-window
@christianparpart
christianparpart / progress-bar-demo.cpp
Created May 2, 2022 08:08
C++ Progress bar, using new Fira Code inspired codepoints.
#include <array>
#include <chrono>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string_view>
#include <thread>
using namespace std;
using namespace std::chrono;
soltest.exe!solidity::yul::StructuralSimplifier::simplify(std::vector<std::variant<solidity::yul::ExpressionStatement,solidity::yul::Assignment,solidity::yul::VariableDeclaration,solidity::yul::FunctionDefinition,solidity::yul::If,solidity::yul::Switch,solidity::yul::ForLoop,solidity::yul::Break,solidity::yul::Continue,solidity::yul::Leave,solidity::yul::Block>,std::allocator<std::variant<solidity::yul::ExpressionStatement,solidity::yul::Assignment,solidity::yul::VariableDeclaration,solidity::yul::FunctionDefinition,solidity::yul::If,solidity::yul::Switch,solidity::yul::ForLoop,solidity::yul::Break,solidity::yul::Continue,solidity::yul::Leave,solidity::yul::Block>>> & _statements) Line 129
at C:\source\ethereum\solidity\libyul\optimiser\StructuralSimplifier.cpp(129)
soltest.exe!solidity::yul::StructuralSimplifier::operator()(solidity::yul::Block & _block) Line 92
at C:\source\ethereum\solidity\libyul\optimiser\StructuralSimplifier.cpp(92)
soltest.exe!solidity::yul::ASTModifier::operator()(solidity::yul::If
@christianparpart
christianparpart / solidity-launch.json
Created April 6, 2022 09:14
VScode launch.json for Solidity
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "solc",
"type": "cppdbg",
"request": "launch",
@christianparpart
christianparpart / solidity-settings.json
Created April 6, 2022 09:12
VScode settings.json for Solidity
{
"search.exclude": {
"**/build": true,
"**/release": true,
"**/out": true
},
"cmake.generator": "Ninja",
"cmake.parallelJobs": 24,
"cmake.configureSettings": {
"VCPKG_TARGET_TRIPLET": "x64-windows",