terminal user interface to jujutsu. Focused on speed and clarity
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix notty building

Eli Dowling 7601186f 9c658126

+206 -49
+2
forks/lwd/dune-project
··· 24 24 (depends 25 25 dune 26 26 seq 27 + logs 27 28 (ocaml 28 29 (>= "5.2")) 29 30 (qtest :with-test) ··· 35 36 (allow_empty) 36 37 (depends 37 38 lwd 39 + logs 38 40 (picos (>= "0.6.0")) 39 41 (picos_std (>= "0.6.0")))) 40 42 (package
+2
forks/nottui/.gitignore
··· 27 27 28 28 # Local OPAM switch 29 29 _opam/ 30 + 31 + .direnv
+13 -10
forks/nottui/dune-project
··· 12 12 13 13 (license MIT) 14 14 15 - (authors 16 - "Frédéric Bour" 17 - "Eli Dowling" 18 - ) 15 + (authors "Frédéric Bour" "Eli Dowling") 19 16 20 - (maintainers 21 - "fred@tarides.com" 22 - "eli.jambu@gmail.com" 23 - ) 17 + (maintainers "fred@tarides.com" "eli.jambu@gmail.com") 24 18 25 19 (package 26 20 (name nottui) ··· 32 26 (notty 33 27 (>= 0.2)) 34 28 (logs 35 - (>= 0.7.0)) 29 + (>= 0.8.0)) 30 + (signal 31 + (>= 0.4.0)) 36 32 (cbor :with-test) ; for the examples 37 33 (containers :with-test))) 38 34 ··· 62 58 (synopsis "Run Nottui UIs using picos") 63 59 (documentation "https://let-def.github.io/lwd/doc") 64 60 (depends 65 - (picos(>= 0.6.0)) 61 + (picos 62 + (>= 0.6.0)) 63 + (picos_io 64 + (>= 0.6.0)) 65 + (picos_std 66 + (>= 0.6.0)) 67 + (logs 68 + (>= 0.8.0)) 66 69 (lwd_picos 67 70 (= :version)) 68 71 (nottui
+17
forks/notty/.github/workflows/build.yml
··· 1 + name: "Build" 2 + on: 3 + pull_request: 4 + push: 5 + branches: 6 + - main 7 + jobs: 8 + tests: 9 + runs-on: ubuntu-latest 10 + steps: 11 + - uses: actions/checkout@v2 12 + - uses: cachix/install-nix-action@v18 13 + - name: "Run nix flake check" 14 + run: nix flake check 15 + - name: "Run nix build" 16 + run: nix build 17 +
+18 -6
forks/notty/dune-project
··· 1 1 (lang dune 3.5 ) 2 2 (name notty) 3 - (version %%VERSION_NUM%%) 3 + (version 0.3.0 ) 4 4 (generate_opam_files true) 5 5 6 6 (package 7 - (name notty) 7 + (name notty) 8 + (synopsis "Declaring terminals") 9 + (description 10 + "Notty is a declarative terminal library for OCaml structured around a notion of composable images. It tries to abstract away the basic terminal programming model, providing something simpler and more expressive.") 11 + (authors "David Kaloper <dk505@cam.ac.uk>") 12 + (maintainers "David Kaloper <dk505@cam.ac.uk>") 13 + (license ISC) 14 + (homepage "https://github.com/pqwy/notty") 15 + (bug_reports "https://github.com/pqwy/notty/issues") 8 16 (documentation "https://pqwy.github.io/notty/doc") 9 - (depends 10 - (cppo (>= 1.1.0)) 11 - (uutf (>= 1.0.0)) 12 - )) 17 + (source (github pqwy/notty)) 18 + (depends 19 + (ocaml (>= "4.08.0")) 20 + (dune (>= "1.7")) 21 + (cppo (>= "1.1.0")) 22 + (uutf (>= "1.0.0"))) 23 + (conflicts (lwt (< "2.5.2"))) 24 + (depopts lwt)) 13 25
+12 -9
forks/notty/examples/colors.ml
··· 27 27 ] 28 28 29 29 let styles = A.[ 30 - "empty" , empty 31 - ; "bold" , st bold 32 - ; "italic" , st italic 33 - ; "underline" , st underline 34 - ; "blink" , st blink 35 - ; "reverse" , st reverse 36 - ; "bold/italic", st bold ++ st italic 37 - ; "rev/underln", st underline ++ st reverse 38 - ; "bold/rev" , st reverse ++ st bold 30 + "empty" , empty 31 + ; "bold" , st bold 32 + ; "faint" , st faint 33 + ; "italic" , st italic 34 + ; "underline" , st underline 35 + ; "blink" , st blink 36 + ; "reverse" , st reverse 37 + ; "bold/italic" , st bold ++ st italic 38 + ; "faint/italic", st faint ++ st italic 39 + ; "rev/underln" , st underline ++ st reverse 40 + ; "bold/rev" , st reverse ++ st bold 41 + ; "faint/rev" , st reverse ++ st faint 39 42 ] 40 43 41 44 let image w =
+60
forks/notty/flake.lock
··· 1 + { 2 + "nodes": { 3 + "flake-utils": { 4 + "inputs": { 5 + "systems": "systems" 6 + }, 7 + "locked": { 8 + "lastModified": 1694529238, 9 + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", 10 + "owner": "numtide", 11 + "repo": "flake-utils", 12 + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", 13 + "type": "github" 14 + }, 15 + "original": { 16 + "owner": "numtide", 17 + "repo": "flake-utils", 18 + "type": "github" 19 + } 20 + }, 21 + "nixpkgs": { 22 + "locked": { 23 + "lastModified": 1695997967, 24 + "narHash": "sha256-P0ZoSe9Mzi1JmhigvSWQIgI0sZnqYvZAjNnm8bntVXs=", 25 + "owner": "nixos", 26 + "repo": "nixpkgs", 27 + "rev": "083b785f8a4ce9775aef48e52d3adf4b899450f6", 28 + "type": "github" 29 + }, 30 + "original": { 31 + "owner": "nixos", 32 + "repo": "nixpkgs", 33 + "type": "github" 34 + } 35 + }, 36 + "root": { 37 + "inputs": { 38 + "flake-utils": "flake-utils", 39 + "nixpkgs": "nixpkgs" 40 + } 41 + }, 42 + "systems": { 43 + "locked": { 44 + "lastModified": 1681028828, 45 + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", 46 + "owner": "nix-systems", 47 + "repo": "default", 48 + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", 49 + "type": "github" 50 + }, 51 + "original": { 52 + "owner": "nix-systems", 53 + "repo": "default", 54 + "type": "github" 55 + } 56 + } 57 + }, 58 + "root": "root", 59 + "version": 7 60 + }
+31
forks/notty/flake.nix
··· 1 + { 2 + description = "Notty Nix Flake"; 3 + 4 + inputs.flake-utils.url = "github:numtide/flake-utils"; 5 + inputs.nixpkgs.url = "github:nixos/nixpkgs"; 6 + 7 + outputs = { self, nixpkgs, flake-utils }: 8 + flake-utils.lib.eachDefaultSystem (system: 9 + let 10 + pkgs = nixpkgs.legacyPackages."${system}"; 11 + inherit (pkgs.ocamlPackages) buildDunePackage; 12 + in 13 + rec { 14 + packages = rec { 15 + default = notty; 16 + notty = buildDunePackage { 17 + pname = "notty"; 18 + version = "n/a"; 19 + src = ./.; 20 + duneVersion = "3"; 21 + nativeBuildInputs = with pkgs.ocamlPackages; [ cppo ]; 22 + propagatedBuildInputs = with pkgs.ocamlPackages; [ uutf ]; 23 + doCheck = true; 24 + }; 25 + }; 26 + devShells.default = pkgs.mkShell { 27 + inputsFrom = pkgs.lib.attrValues packages; 28 + buildInputs = with pkgs.ocamlPackages; [ ocaml-lsp ]; 29 + }; 30 + }); 31 + }
+20 -20
forks/notty/notty.opam
··· 1 - # This file is generated by dune, edit dune-project instead 2 1 opam-version: "2.0" 3 - version: "%%VERSION_NUM%%" 4 - doc: "https://pqwy.github.io/notty/doc" 2 + homepage: "https://github.com/pqwy/notty" 3 + dev-repo: "git+https://github.com/pqwy/notty.git" 4 + bug-reports: "https://github.com/pqwy/notty/issues" 5 + doc: "https://pqwy.github.io/notty/doc" 6 + author: "David Kaloper <dk505@cam.ac.uk>" 7 + maintainer: "David Kaloper <dk505@cam.ac.uk>" 8 + license: "ISC" 9 + synopsis: "Declaring terminals" 10 + description: 11 + "Notty is a declarative terminal library for OCaml structured around a notion 12 + of composable images. It tries to abstract away the basic terminal programming 13 + model, providing something simpler and more expressive." 14 + 15 + build: [ [ "dune" "subst" ] {dev} 16 + [ "dune" "build" "-p" name "-j" jobs ] ] 5 17 depends: [ 6 - "dune" {>= "3.5"} 7 - "cppo" {>= "1.1.0"} 18 + "ocaml" {>= "4.08.0"} 19 + "dune" {>= "1.7"} 20 + "cppo" {build & >= "1.1.0"} 8 21 "uutf" {>= "1.0.0"} 9 - "odoc" {with-doc} 10 22 ] 11 - build: [ 12 - ["dune" "subst"] {dev} 13 - [ 14 - "dune" 15 - "build" 16 - "-p" 17 - name 18 - "-j" 19 - jobs 20 - "@install" 21 - "@runtest" {with-test} 22 - "@doc" {with-doc} 23 - ] 24 - ] 23 + depopts: [ "lwt" ] 24 + conflicts: [ "lwt" {<"2.5.2"} ]
+31 -4
forks/notty/src-unix/native/winsize.c
··· 1 + #include <caml/mlvalues.h> 2 + 3 + #ifdef _WIN32 4 + #include <windows.h> 5 + #else 1 6 #include <sys/ioctl.h> 2 7 #include <signal.h> 3 - #include <caml/mlvalues.h> 8 + #endif 9 + 10 + #ifdef __HAIKU__ 11 + /* On some platforms, ioctl() is declared in <unistd.h>. */ 12 + #include <unistd.h> 13 + #endif 4 14 5 15 CAMLprim value caml_notty_winsize (value vfd) { 16 + #ifdef _WIN32 17 + (void) vfd; 18 + HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); 19 + if (hConsole == INVALID_HANDLE_VALUE) return Val_int (0); 20 + 21 + CONSOLE_SCREEN_BUFFER_INFO csbi; 22 + if (GetConsoleScreenBufferInfo(hConsole, &csbi)) { 23 + int columns = csbi.srWindow.Right - csbi.srWindow.Left + 1; 24 + int rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1; 25 + return Val_int ((columns << 16) + ((rows & 0x7fff) << 1)); 26 + } 27 + return Val_int (0); 28 + #else 6 29 int fd = Int_val (vfd); 7 30 struct winsize w; 8 31 if (ioctl (fd, TIOCGWINSZ, &w) >= 0) 9 32 return Val_int ((w.ws_col << 16) + ((w.ws_row & 0x7fff) << 1)); 10 33 return Val_int (0); 34 + #endif 11 35 } 12 36 13 - #define __unit() value unit __attribute__((unused)) 14 - 15 - CAMLprim value caml_notty_winch_number (__unit()) { 37 + CAMLprim value caml_notty_winch_number (value vunit) { 38 + (void) vunit; 39 + #ifdef _WIN32 40 + return Val_int (0); 41 + #else 16 42 return Val_int (SIGWINCH); 43 + #endif 17 44 }