packages feed

termonad 1.0.0.0 → 1.0.1.0

raw patch · 11 files changed

+200/−116 lines, 11 filessetup-changedPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Termonad.Config.Vec: fromListVec :: Sing n -> [a] -> Maybe (Vec n a)
+ Termonad.Config.Vec: fromListVec_ :: SingI n => [a] -> Maybe (Vec n a)
+ Termonad.Config.Vec: unsafeFromListVec :: Sing n -> [a] -> Vec n a
+ Termonad.Config.Vec: unsafeFromListVec_ :: SingI n => [a] -> Vec n a
- Termonad.Config.Colour: lensBackgroundColour :: forall c_a2csI. Lens' (ColourConfig c_a2csI) c_a2csI
+ Termonad.Config.Colour: lensBackgroundColour :: forall c_a2cIk. Lens' (ColourConfig c_a2cIk) c_a2cIk
- Termonad.Config.Colour: lensCursorBgColour :: forall c_a2csI. Lens' (ColourConfig c_a2csI) (Option c_a2csI)
+ Termonad.Config.Colour: lensCursorBgColour :: forall c_a2cIk. Lens' (ColourConfig c_a2cIk) (Option c_a2cIk)
- Termonad.Config.Colour: lensCursorFgColour :: forall c_a2csI. Lens' (ColourConfig c_a2csI) (Option c_a2csI)
+ Termonad.Config.Colour: lensCursorFgColour :: forall c_a2cIk. Lens' (ColourConfig c_a2cIk) (Option c_a2cIk)
- Termonad.Config.Colour: lensForegroundColour :: forall c_a2csI. Lens' (ColourConfig c_a2csI) c_a2csI
+ Termonad.Config.Colour: lensForegroundColour :: forall c_a2cIk. Lens' (ColourConfig c_a2cIk) c_a2cIk
- Termonad.Config.Colour: lensPalette :: forall c_a2csI. Lens' (ColourConfig c_a2csI) (Palette c_a2csI)
+ Termonad.Config.Colour: lensPalette :: forall c_a2cIk. Lens' (ColourConfig c_a2cIk) (Palette c_a2cIk)

Files

.nix-helpers/nixpkgs.nix view
@@ -6,13 +6,13 @@ { compiler ? null, nixpkgs ? null }:  let-  # recent version of nixpkgs as of 2018-11-09   nixpkgsSrc =     if isNull nixpkgs       then         builtins.fetchTarball {-          url = "https://github.com/NixOS/nixpkgs/archive/237285295764fb063ec1ca509c36b17c4990eeb4.tar.gz";-          sha256 = "1cl40yz7ry6x2nbzpc5pkf0q5p0fxvi0c2n7la0pz5g1n80n4xlq";+          # version of nixpkgs as of 2018-11-21+          url = "https://github.com/NixOS/nixpkgs/archive/a370bd1fed5fcce0bb260fb6a5213911f1441eac.tar.gz";+          sha256 = "17zj2yay3wgmgh1pwmgh6fcpqnrw7fl9riv852z3l38711by5ar4";         }       else         nixpkgs;@@ -32,6 +32,7 @@             ./..;         termonad = callCabal2nix "termonad" src {           inherit (gnome3) gtk3;+          vte_291 = gnome3.vte;         };       in       overrideCabal termonad (oldAttrs: {@@ -40,6 +41,12 @@         doCheck = false;       }); +  # This is only used when older versions of nixpkgs are being used that don't have+  # the focuslist package yet.  Eventually this can probably be completely dropped+  # around July of 2019 or so.+  #+  # Also, if Termonad starts depending on a newer version of focuslist, this will+  # have to be updated.   myfocuslist = callCabal2nix:     let       src = builtins.fetchTarball {@@ -48,24 +55,12 @@       };     in callCabal2nix "focuslist" src {}; -  gobjIntroOverride = oldAttrs: {-    patches = oldAttrs.patches ++ [ ./macos-gobject-introspection-rpath.patch ];-  };-   haskellPackagesOL = self: super: with super.haskell.lib; {     haskellPackages = super.haskell.packages.${compilerVersion}.override {       overrides = hself: hsuper: {         # Only override the version of foculist if it doesn't already exist in         # the haskell package set.         focuslist = hsuper.focuslist or (myfocuslist hself.callCabal2nix);--        # Set the haskell-gi libraries to generate documentation.-        gi-gdk = doHaddock hsuper.gi-gdk;-        gi-gio = doHaddock hsuper.gi-gio;-        gi-glib = doHaddock hsuper.gi-glib;-        gi-gtk = doHaddock hsuper.gi-gtk;-        gi-pango = doHaddock hsuper.gi-pango;-        gi-vte = doHaddock hsuper.gi-vte;          termonad = termonadOverride self.stdenv.lib self.gnome3 hself.callCabal2nix self.haskell.lib.overrideCabal; 
CHANGELOG.md view
@@ -1,3 +1,14 @@+## 1.0.1.0++* Stop using the `widgetSetFocusOnClick` function, which is not supported on+  older versions of GTK. This lets Termonad be compiled with older versions+  of GTK. [#87](https://github.com/cdepillabout/termonad/pull/87).+* Add CI. [#87](https://github.com/cdepillabout/termonad/pull/87).+* Support versions of VTE-2.91 older than 0.44.+  [#87](https://github.com/cdepillabout/termonad/pull/87).+* Add some functions for converting from a list to a `Vec` in+  `Termonad.Config.Vec`: `fromListVec` and `fromListVec_`.  Commit 883eb98b5f.+* Fix the paste hotkey. [#86](https://github.com/cdepillabout/termonad/pull/86).  ## 1.0.0.0 
README.md view
@@ -30,7 +30,7 @@             - [Installing with `stack` using `nix`](#installing-with-stack-using-nix)         - [Windows](#windows)     - [How to use Termonad](#how-to-use-termonad)-        - [Default Keybindings](#default-keybindings)+        - [Default Key Bindings](#default-key-bindings)         - [Configuring Termonad](#configuring-termonad)         - [Compiling Local Settings](#compiling-local-settings)             - [Running with `stack`](#running-with-stack)@@ -196,7 +196,7 @@ $ ~/.local/bin/termonad ``` -The following section describes the default keybindings.+The following section describes the default key bindings.  If you would like to configure Termonad with your own settings, first you will need to create a Haskell file called `~/.config/termonad/termonad.hs`. A following@@ -218,11 +218,11 @@ where GHC is, as well as where all your Haskell packages live. This presents some difficulties that will be discussed in a following section. -### Default Keybindings+### Default Key Bindings  Termonad provides the following default key bindings. -| Keybinding | Action |+| Key binding | Action | |------------|--------| | <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>t</kbd> | Open new tab. | | <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>w</kbd> | Close tab. |
Setup.hs view
@@ -27,8 +27,8 @@ import Distribution.Extra.Doctest (addDoctestsUserHook) main :: IO () main = do-  cppOpts <- getGtkVersionCPPOpts-  defaultMainWithHooks . addPkgConfigGtkUserHook cppOpts $+  cppOpts <- getTermonadCPPOpts+  defaultMainWithHooks . addPkgConfigTermonadUserHook cppOpts $     addDoctestsUserHook "doctests" simpleUserHooks  #else@@ -46,21 +46,22 @@  main :: IO () main = do-  cppOpts <- getGtkVersionCPPOpts-  defaultMainWithHooks $ addPkgConfigGtkUserHook cppOpts simpleUserHooks+  cppOpts <- getTermonadCPPOpts+  defaultMainWithHooks $ addPkgConfigTermonadUserHook cppOpts simpleUserHooks  #endif --- | Add CPP macros representing the version of the GTK system library.-addPkgConfigGtkUserHook :: [String] -> UserHooks -> UserHooks-addPkgConfigGtkUserHook cppOpts oldUserHooks = do+-- | Add CPP macros representing the version of the GTK and VTE system+-- libraries.+addPkgConfigTermonadUserHook :: [String] -> UserHooks -> UserHooks+addPkgConfigTermonadUserHook cppOpts oldUserHooks = do   oldUserHooks-    { preBuild = pkgConfigGtkHook cppOpts $ preBuild oldUserHooks-    , preRepl = pkgConfigGtkHook cppOpts (preRepl oldUserHooks)+    { preBuild = pkgConfigTermonadHook cppOpts $ preBuild oldUserHooks+    , preRepl = pkgConfigTermonadHook cppOpts (preRepl oldUserHooks)     } -pkgConfigGtkHook :: [String] -> (args -> flags -> IO HookedBuildInfo) -> args -> flags -> IO HookedBuildInfo-pkgConfigGtkHook cppOpts oldFunc args flags = do+pkgConfigTermonadHook :: [String] -> (args -> flags -> IO HookedBuildInfo) -> args -> flags -> IO HookedBuildInfo+pkgConfigTermonadHook cppOpts oldFunc args flags = do   (maybeOldLibHookedInfo, oldExesHookedInfo) <- oldFunc args flags   case maybeOldLibHookedInfo of     Just oldLibHookedInfo -> do@@ -76,26 +77,35 @@               }       pure (Just newLibHookedInfo, oldExesHookedInfo) +getTermonadCPPOpts :: IO [String]+getTermonadCPPOpts = do+  gtk <- getGtkVersionCPPOpts+  vte <- getVteVersionCPPOpts+  pure $ gtk <> vte++getVteVersionCPPOpts :: IO [String]+getVteVersionCPPOpts = do+  maybeVers <- getPkgConfigVersionFor "vte-2.91"+  case maybeVers of+    Nothing -> pure []+    Just vers -> pure $ createVteVersionCPPOpts vers+ getGtkVersionCPPOpts :: IO [String] getGtkVersionCPPOpts = do-  pkgDb <- configureProgram normal pkgConfigProgram defaultProgramConfiguration-  pkgConfigOutput <--    getDbProgramOutput normal pkgConfigProgram pkgDb ["--modversion", "gtk+-3.0"]-  -- Drop the newline on the end of the pkgConfigOutput.-  -- This should give us a version number like @3.22.11@.-  let rawGtkVersion = reverse $ drop 1 $ reverse pkgConfigOutput-  let maybeGtkVersion = simpleParse rawGtkVersion-  case maybeGtkVersion of-    Nothing -> do-      putStrLn "In Setup.hs, in getGtkVersionCPPOpts, could not parse gtk version:"-      print pkgConfigOutput-      putStrLn "\nNot defining any CPP macros based on the version of the system GTK library."-      putStrLn "\nCompilation of termonad may fail."-      pure []-    Just gtkVersion -> do-      let cppOpts = createGtkVersionCPPOpts gtkVersion-      pure cppOpts+  maybeVers <- getPkgConfigVersionFor "gtk+-3.0"+  case maybeVers of+    Nothing -> pure []+    Just vers -> pure $ createGtkVersionCPPOpts vers +-- | Just like 'createGtkVersionCPPOpts' but for VTE instead of GTK.+createVteVersionCPPOpts+  :: Version+  -> [String]+createVteVersionCPPOpts vers =+  catMaybes $+    [ if vers >= [0,44] then Just "-DVTE_VERSION_GEQ_0_44" else Nothing+    ]+ -- | Based on the version of the GTK3 library as reported by @pkg-config@, return -- a list of CPP macros that contain the GTK version.  These can be used in the -- Haskell code to work around differences in the gi-gtk library Haskell@@ -109,3 +119,24 @@   catMaybes $     [ if gtkVersion >= [3,22] then Just "-DGTK_VERSION_GEQ_3_22" else Nothing     ]++getPkgConfigVersionFor :: String -> IO (Maybe Version)+getPkgConfigVersionFor program = do+  pkgDb <- configureProgram normal pkgConfigProgram defaultProgramConfiguration+  pkgConfigOutput <-+    getDbProgramOutput normal pkgConfigProgram pkgDb ["--modversion", program]+  -- Drop the newline on the end of the pkgConfigOutput.+  -- This should give us a version number like @3.22.11@.+  let rawProgramVersion = reverse $ drop 1 $ reverse pkgConfigOutput+  let maybeProgramVersion = simpleParse rawProgramVersion+  case maybeProgramVersion of+    Nothing -> do+      putStrLn $+        "In Setup.hs, in getPkgConfigVersionFor, could not parse " <>+        program <> " version: " <> show pkgConfigOutput+      putStrLn $+        "\nNot defining any CPP macros based on the version of the system " <>+        program <> " library."+      putStrLn "\nCompilation of termonad may fail."+      pure Nothing+    Just programVersion -> pure $ Just programVersion
example-config/ExampleColourExtension.hs view
@@ -11,11 +11,11 @@   , start   ) import Termonad.Config.Colour-  ( Colour, ColourConfig, Palette(BasicPalette), addColourExtension+  ( Colour, ColourConfig, Palette(ExtendedPalette), addColourExtension   , createColourExtension, cursorBgColour, defaultColourConfig, foregroundColour   , palette, sRGB24   )-import Termonad.Config.Vec (Vec((:*), EmptyVec), N8)+import Termonad.Config.Vec (Vec((:*), EmptyVec), N8, unsafeFromListVec_) import Data.Colour.SRGB (Colour, sRGB24)  -- This is our main 'TMConfig'.  It holds all of the non-colour settings@@ -43,11 +43,13 @@     { cursorBgColour = Set (sRGB24 120 80 110) -- purple     -- Set the default foreground colour of text of the terminal.     , foregroundColour = sRGB24 220 180 210 -- light pink-    -- Set the basic palette that has 8 colours.-    , palette = BasicPalette myStandardColours+    -- Set the extended palette that has 8 colours standard colors and then 8+    -- light colors.+    , palette = ExtendedPalette myStandardColours myLightColours     }   where-    -- This is a length-indexed linked-list of colours.+    -- This is a an example of creating a length-indexed linked-list of colours,+    -- using 'Vec' constructors.     myStandardColours :: Vec N8 (Colour Double)     myStandardColours =          sRGB24  40  30  20 -- dark brown (used as background colour)@@ -59,6 +61,22 @@       :* sRGB24  40 160 120 -- teal       :* sRGB24 180 160 120 -- light brown       :* EmptyVec++    -- This is an example of creating a length-indenxed linked-list of colours,+    -- using the 'unsafeFromListVec_' function.  'unsafeFromListVec_' is okay to+    -- use as long as you're absolutely sure you have 8 elements.+    myLightColours :: Vec N8 (Colour Double)+    myLightColours =+      unsafeFromListVec_+        [ sRGB24  70  60  50 -- brown+        , sRGB24 220  30  20 -- light red+        , sRGB24  40 210  20 -- light green+        , sRGB24 220 200  20 -- yellow+        , sRGB24  40  30 180 -- purple+        , sRGB24 140  30 80  -- dark pink+        , sRGB24  50 200 160 -- light teal+        , sRGB24 220 200 150 -- light brown+        ]  main :: IO () main = do
src/Termonad/App.hs view
@@ -341,7 +341,7 @@     maybeTerm <- getFocusedTermFromState mvarTMState     maybe (pure ()) terminalPasteClipboard maybeTerm   actionMapAddAction app pasteAction-  applicationSetAccelsForAction app "app.paste" ["<Shift><Ctrl>C"]+  applicationSetAccelsForAction app "app.paste" ["<Shift><Ctrl>V"]    aboutAction <- simpleActionNew "about" Nothing   void $ onSimpleActionActivate aboutAction (const $ showAboutDialog app)@@ -417,51 +417,51 @@ -- -- - @~\/.config\/termonad\/termonad.hs@ exists, @~\/.cache\/termonad\/termonad-linux-x86_64@ exists -----   The timestamps of these two files are checked.  If the---   @~\/.config\/termonad\/termonad.hs@ file has been modified after the---   @~\/.cache\/termonad\/termonad-linux-x86_64@ binary, then Termonad will use---   GHC to recompile the @~\/.config\/termonad\/termonad.hs@ file, producing a---   new binary at @~\/.cache\/termonad\/termonad-linux-x86_64@.  This new binary---   will be re-executed.  The 'TMConfig' passed to this 'defaultMain' will be---   effectively thrown away.+--     The timestamps of these two files are checked.  If the+--     @~\/.config\/termonad\/termonad.hs@ file has been modified after the+--     @~\/.cache\/termonad\/termonad-linux-x86_64@ binary, then Termonad will use+--     GHC to recompile the @~\/.config\/termonad\/termonad.hs@ file, producing a+--     new binary at @~\/.cache\/termonad\/termonad-linux-x86_64@.  This new binary+--     will be re-executed.  The 'TMConfig' passed to this 'defaultMain' will be+--     effectively thrown away. -----   If GHC fails to recompile the @~\/.config\/termonad\/termonad.hs@ file, then---   Termonad will just execute 'start' with the 'TMConfig' passed in.+--     If GHC fails to recompile the @~\/.config\/termonad\/termonad.hs@ file, then+--     Termonad will just execute 'start' with the 'TMConfig' passed in. -----   If the @~\/.cache\/termonad\/termonad-linux-x86_64@ binary has been modified---   after the @~\/.config\/termonad\/termonad.hs@ file, then Termonad will---   re-exec the @~\/.cache\/termonad\/termonad-linux-x86_64@ binary.  The---   'TMConfig' passed to this 'defaultMain' will be effectively thrown away.+--     If the @~\/.cache\/termonad\/termonad-linux-x86_64@ binary has been modified+--     after the @~\/.config\/termonad\/termonad.hs@ file, then Termonad will+--     re-exec the @~\/.cache\/termonad\/termonad-linux-x86_64@ binary.  The+--     'TMConfig' passed to this 'defaultMain' will be effectively thrown away. -- -- - @~\/.config\/termonad\/termonad.hs@ exists, @~\/.cache\/termonad\/termonad-linux-x86_64@ does not exist -----   Termonad will use GHC to recompile the @~\/.config\/termonad\/termonad.hs@---   file, producing a new binary at @~\/.cache\/termonad\/termonad-linux-x86_64@.---   This new binary will be re-executed.  The 'TMConfig' passed to this---   'defaultMain' will be effectively thrown away.+--     Termonad will use GHC to recompile the @~\/.config\/termonad\/termonad.hs@+--     file, producing a new binary at @~\/.cache\/termonad\/termonad-linux-x86_64@.+--     This new binary will be re-executed.  The 'TMConfig' passed to this+--     'defaultMain' will be effectively thrown away. -----   If GHC fails to recompile the @~/.config/termonad/termonad.hs@ file, then---   Termonad will just execute 'start' with the 'TMConfig' passed in.+--     If GHC fails to recompile the @~\/.config\/termonad\/termonad.hs@ file, then+--     Termonad will just execute 'start' with the 'TMConfig' passed in. ----- - @~/.config/termonad/termonad.hs@ does not exist, @~/.cache/termonad/termonad-linux-x86_64@ exists+-- - @~\/.config\/termonad\/termonad.hs@ does not exist, @~\/.cache\/termonad\/termonad-linux-x86_64@ exists -----   Termonad will ignore the @~/.cache/termonad/termonad-linux-x86_64@ binary---   and just run 'start' with the 'TMConfig' passed to this function.+--     Termonad will ignore the @~\/.cache\/termonad\/termonad-linux-x86_64@ binary+--     and just run 'start' with the 'TMConfig' passed to this function. ----- - @~/.config/termonad/termonad.hs@ does not exist, @~/.cache/termonad/termonad-linux-x86_64@ does not exist+-- - @~\/.config\/termonad\/termonad.hs@ does not exist, @~\/.cache\/termonad\/termonad-linux-x86_64@ does not exist -----   Termonad will run 'start' with the 'TMConfig' passed to this function.+--     Termonad will run 'start' with the 'TMConfig' passed to this function. -- -- Other notes: ----- 1. That the locations of @~/.config/termonad/termonad.hs@ and---    @~/.cache/termonad/termonad-linux-x86_64@ may differ depending on your+-- 1. That the locations of @~\/.config\/termonad\/termonad.hs@ and+--    @~\/.cache\/termonad\/termonad-linux-x86_64@ may differ depending on your --    system. ----- 2. In your own @~/.config/termonad/termonad.hs@ file, you can use either+-- 2. In your own @~\/.config\/termonad\/termonad.hs@ file, you can use either --    'defaultMain' or 'start'.  As long as you always execute the system-wide --    @termonad@ binary (instead of the binary produced as---    @~/.cache/termonad/termonad-linux-x86_64@), the effect should be the same.+--    @~\/.cache\/termonad\/termonad-linux-x86_64@), the effect should be the same. defaultMain :: TMConfig -> IO () defaultMain tmConfig = do   let params =
src/Termonad/Config/Colour.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-}  -- | Module    : Termonad.Config.Colour@@ -61,7 +62,9 @@   ( Terminal   , terminalSetColors   , terminalSetColorCursor+#ifdef VTE_VERSION_GEQ_0_44   , terminalSetColorCursorForeground+#endif --, terminalSetColorBackground   , terminalSetColorForeground   )@@ -347,48 +350,53 @@ -- -- * 'cursorFgColour' is 'Set' and 'cursorBgColour' is 'Set' -----   The foreground and background colors of the cursor are as you have set.+--     The foreground and background colors of the cursor are as you have set. -- -- * 'cursorFgColour' is 'Set' and 'cursorBgColour' is 'Unset' -----   The cursor background color turns completely black so that it is not---   visible.  The foreground color of the cursor is the color that you have---   'Set'.  This ends up being mostly unusable, so you are recommended to---   always 'Set' 'cursorBgColour' when you have 'Set' 'cursorFgColour'.+--     The cursor background color turns completely black so that it is not+--     visible.  The foreground color of the cursor is the color that you have+--     'Set'.  This ends up being mostly unusable, so you are recommended to+--     always 'Set' 'cursorBgColour' when you have 'Set' 'cursorFgColour'. -- -- * 'cursorFgColour' is 'Unset' and 'cursorBgColour' is 'Set' -----   The cursor background color becomes the color you 'Set', while the cursor---   foreground color doesn't change from the letter it is over.  For instance,---   imagine there is a letter on the screen with a black background and a---   green foreground.  If you bring the cursor overtop of it, the cursor---   background will be the color you have 'Set', while the cursor foreground---   will be green.+--     The cursor background color becomes the color you 'Set', while the cursor+--     foreground color doesn't change from the letter it is over.  For instance,+--     imagine there is a letter on the screen with a black background and a+--     green foreground.  If you bring the cursor overtop of it, the cursor+--     background will be the color you have 'Set', while the cursor foreground+--     will be green. -----   This is completely usable, but is slightly annoying if you place the cursor---   over a letter with the same foreground color as the cursor's background---   color, because the letter will not be readable. For instance, imagine you---   have set your cursor background color to red, and somewhere on the screen---   there is a letter with a black background and a red foreground. If you move---   your cursor over the letter, the background of the cursor will be red (as---   you have set), and the cursor foreground will be red (to match the original---   foreground color of the letter). This will make it so you can't---   actually read the letter, because the foreground and background are both---   red.+--     This is completely usable, but is slightly annoying if you place the cursor+--     over a letter with the same foreground color as the cursor's background+--     color, because the letter will not be readable. For instance, imagine you+--     have set your cursor background color to red, and somewhere on the screen+--     there is a letter with a black background and a red foreground. If you move+--     your cursor over the letter, the background of the cursor will be red (as+--     you have set), and the cursor foreground will be red (to match the original+--     foreground color of the letter). This will make it so you can't+--     actually read the letter, because the foreground and background are both+--     red. -- -- * 'cursorFgColour' is 'Unset' and 'cursorBgColour' is 'Unset' -----   This combination makes the cursor inverse of whatever text it is over.---   If your cursor is over red text with a black background, the cursor---   background will be red and the cursor foreground will be black.+--     This combination makes the cursor inverse of whatever text it is over.+--     If your cursor is over red text with a black background, the cursor+--     background will be red and the cursor foreground will be black. -----   This is the default.+--     This is the default. --+-- 'cursorFgColour' is not supported in @vte-2.91@ versions older than 0.44.+-- (This is somewhat confusing. Note that @vte-2.91@ is the name of the system+-- library, and @0.44@ is its version number.)+-- -- See 'defaultColourConfig' for the defaults for 'ColourConfig' used in Termonad. data ColourConfig c = ColourConfig   { cursorFgColour :: !(Option c) -- ^ Foreground color of the cursor.  This is                                   -- the color of the text that the cursor is-                                  -- over.+                                  -- over.  This is not supported on older+                                  -- versions of VTE.   , cursorBgColour :: !(Option c) -- ^ Background color of the cursor.  This is                                   -- the color of the cursor itself.   , foregroundColour :: !c -- ^ Color of the default default foreground text in@@ -457,7 +465,9 @@   let optPerform setC cField = whenSet (cField colourConf) $ \c ->         setC vteTerm . Just =<< toRGBA c   optPerform terminalSetColorCursor cursorBgColour+#ifdef VTE_VERSION_GEQ_0_44   optPerform terminalSetColorCursorForeground cursorFgColour+#endif   where     toRGBA :: Colour Double -> IO RGBA     toRGBA colour = do
src/Termonad/Config/Vec.hs view
@@ -372,6 +372,28 @@ setAtVec :: Fin n -> a -> Vec n a -> Vec n a setAtVec fin a = updateAtVec fin (const a) +fromListVec :: Sing n -> [a] -> Maybe (Vec n a)+fromListVec SZ _ = Just EmptyVec+fromListVec (SS _) [] = Nothing+fromListVec (SS n) (a:as) = do+  tailVec <- fromListVec n as+  pure $ ConsVec a tailVec++fromListVec_ :: SingI n => [a] -> Maybe (Vec n a)+fromListVec_ = fromListVec sing++unsafeFromListVec :: Sing n -> [a] -> Vec n a+unsafeFromListVec n as =+  case fromListVec n as of+    Just vec -> vec+    Nothing ->+      error $+        "unsafeFromListVec: couldn't create a length " <>+        show n <> " vector from the input list"++unsafeFromListVec_ :: SingI n => [a] -> Vec n a+unsafeFromListVec_ = unsafeFromListVec sing+ ------------ -- Matrix -- ------------
src/Termonad/Term.hs view
@@ -62,7 +62,6 @@   , widgetDestroy   , widgetGrabFocus   , widgetSetCanFocus-  , widgetSetFocusOnClick   , widgetSetHalign   , widgetSetHexpand   , widgetShow@@ -241,11 +240,8 @@   containerAdd box label   containerAdd box button   widgetSetCanFocus button False-  widgetSetFocusOnClick button False   widgetSetCanFocus label False-  widgetSetFocusOnClick label False   widgetSetCanFocus box False-  widgetSetFocusOnClick box False   widgetShow box   widgetShow label   widgetShow button
termonad.cabal view
@@ -1,5 +1,5 @@ name:                termonad-version:             1.0.0.0+version:             1.0.1.0 synopsis:            Terminal emulator configurable in Haskell description:         Please see <https://github.com/cdepillabout/termonad#readme README.md>. homepage:            https://github.com/cdepillabout/termonad@@ -111,6 +111,7 @@   other-extensions:    TemplateHaskell                      , UndecidableInstances   pkgconfig-depends:   gtk+-3.0+                     , vte-2.91  executable termonad   main-is:             Main.hs
test/readme/README.lhs view
@@ -30,7 +30,7 @@             - [Installing with `stack` using `nix`](#installing-with-stack-using-nix)         - [Windows](#windows)     - [How to use Termonad](#how-to-use-termonad)-        - [Default Keybindings](#default-keybindings)+        - [Default Key Bindings](#default-key-bindings)         - [Configuring Termonad](#configuring-termonad)         - [Compiling Local Settings](#compiling-local-settings)             - [Running with `stack`](#running-with-stack)@@ -196,7 +196,7 @@ $ ~/.local/bin/termonad ``` -The following section describes the default keybindings.+The following section describes the default key bindings.  If you would like to configure Termonad with your own settings, first you will need to create a Haskell file called `~/.config/termonad/termonad.hs`. A following@@ -218,11 +218,11 @@ where GHC is, as well as where all your Haskell packages live. This presents some difficulties that will be discussed in a following section. -### Default Keybindings+### Default Key Bindings  Termonad provides the following default key bindings. -| Keybinding | Action |+| Key binding | Action | |------------|--------| | <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>t</kbd> | Open new tab. | | <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>w</kbd> | Close tab. |