Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small cleanup #237

Merged
merged 6 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,20 +147,25 @@ jobs:

- uses: DeterminateSystems/magic-nix-cache-action@v2

# TODO: This cache actually needs to be keyed on the hash of the
# TODO: These caches actually needs to be keyed on the hash of the
# ./nix-helpers/simple-cabal-shell.nix derivation. If that derivation
# changes, then we really, really should not reuse the same
# ~/.cabal/store directory.
# ~/.cabal/store directory (since there is the possibility of getting
# into a cabal hell, where Haskell libraries in the Cabal store are linked to
# different, incompatible system libraries).
#
# It is possible to get the hash of this derivation with a command like:
#
# $ nix eval --impure --raw --expr 'with (import <nixpkgs> {}).lib; let simpleCabalShell = import ./.nix-helpers/simple-cabal-shell.nix {}; in builtins.elemAt (splitString "-" (removePrefix (builtins.storeDir + "/") simpleCabalShell)) 0'
#
# Just need to load this into a variable, and throw it in the following key name
- uses: actions/cache@v3
name: Cache cabal-store
name: Cache cabal store
with:
path: ~/.config/cabal/store
path: |
~/.cabal/store
~/.config/cabal/store
~/.local/state/cabal/store
key: nix-simple-cabal-shell

- name: cabal update
Expand Down
1 change: 1 addition & 0 deletions .nix-helpers/simple-cabal-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,6 @@ pkgs.mkShell {
pkgs.xorg.libXdmcp
pkgs.xorg.libxcb
pkgs.xorg.libXtst
pkgs.zlib
];
}
1 change: 0 additions & 1 deletion src/Termonad/App.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import Config.Dyre (wrapMain, newParams)
import Control.Lens ((^.), (^..), over, set, view, ix)
import Control.Monad.Fail (fail)
import Data.FileEmbed (embedFile)
import Data.FocusList (focusList, moveFromToFL, updateFocusFL)
import qualified Data.List as List
Expand Down Expand Up @@ -479,7 +478,7 @@
copyAction <- simpleActionNew "copy" Nothing
void $ onSimpleActionActivate copyAction $ \_ -> do
maybeTerm <- getFocusedTermFromState mvarTMState tmWinId
maybe (pure ()) terminalCopyClipboard maybeTerm

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-20.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-22.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-22.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-20.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-22.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-20.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-20.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-22.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-22.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-22.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-22.04

In the use of ‘terminalCopyClipboard’

Check warning on line 481 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-22.04

In the use of ‘terminalCopyClipboard’
actionMapAddAction win copyAction
applicationSetAccelsForAction app "win.copy" ["<Shift><Ctrl>C"]

Expand Down Expand Up @@ -738,7 +737,7 @@
terminalSetScrollbackLines term (fromIntegral (scrollbackLen options))
terminalSetBoldIsBright term (boldIsBright options)
terminalSetEnableSixelIfExists term (enableSixel options)
terminalSetAllowBold term (allowBold options)

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 740 in src/Termonad/App.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

let vScrollbarPolicy = showScrollbarToPolicy (options ^. lensShowScrollbar)
scrolledWindowSetPolicy scrolledWin PolicyTypeAutomatic vScrollbarPolicy
Expand Down
6 changes: 2 additions & 4 deletions src/Termonad/Config/Colour.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ module Termonad.Config.Colour
-- $setup
) where

import Termonad.Prelude hiding ((\\), index)
import Termonad.Prelude

import Control.Lens ((%~), makeLensesFor)
import Data.Colour
Expand Down Expand Up @@ -124,16 +124,14 @@ import GI.Vte
, terminalSetColorHighlight
, terminalSetColorHighlightForeground
)
import Text.Printf (printf)
import Text.Show (showString)

import Termonad.Lenses (lensCreateTermHook, lensHooks)
import Termonad.Types
( Option(Unset)
, TMConfig
, TMState
, whenSet
)
import Text.Printf (printf)

-- $setup
-- >>> import Data.Colour.Names (green, red)
Expand Down
1 change: 0 additions & 1 deletion src/Termonad/Gtk.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import Termonad.Prelude

import Control.Monad.Fail (MonadFail, fail)
import Data.GI.Base (ManagedPtr, withManagedPtr)
import Data.Text (unpack)
import GHC.Stack (HasCallStack)
Expand Down Expand Up @@ -87,7 +86,7 @@
=> t -- ^ a Terminal
-> Bool -- ^ whether to enable SIXEL images
-> m ()
terminalSetEnableSixelIfExists t b = do

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-20.04

Defined but not used: ‘t’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-20.04

Defined but not used: ‘b’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

Defined but not used: ‘t’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

Defined but not used: ‘b’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

Defined but not used: ‘t’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

Defined but not used: ‘b’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-20.04

Defined but not used: ‘t’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-20.04

Defined but not used: ‘b’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-20.04

Defined but not used: ‘t’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-20.04

Defined but not used: ‘b’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-20.04

Defined but not used: ‘t’

Check warning on line 89 in src/Termonad/Gtk.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-20.04

Defined but not used: ‘b’
#ifdef VTE_VERSION_GEQ_0_63
terminalSetEnableSixel t b
#endif
Expand Down
12 changes: 10 additions & 2 deletions src/Termonad/Term.hs
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,23 @@
, TMState
, TMState'(TMState, tmStateConfig, tmStateFontDesc)
, TMTerm
, TMWindow
, TMWindowId
, assertInvariantTMState
, createTMNotebookTab
, getNotebookFromTMState
, getTMNotebookFromTMState
, getTMNotebookFromTMState'
, getTMWindowFromTMState
, getTMWindowFromWins
, newTMTerm
, pid
, tmNotebook
, tmNotebookTabTerm
, tmNotebookTabTermContainer
, tmNotebookTabs, TMWindowId, tmStateWindows, getTMWindowFromWins, tmWindowNotebook, getTMWindowFromTMState, getNotebookFromTMState, getTMNotebookFromTMState, getTMNotebookFromTMState', tmWindowAppWin
, tmNotebookTabs
, tmStateWindows
, tmWindowAppWin
, tmWindowNotebook
)

focusTerm :: Int -> TMState -> TMWindowId -> IO ()
Expand Down Expand Up @@ -384,7 +392,7 @@
terminalSetCursorBlinkMode vteTerm (cursorBlinkMode curOpts)
terminalSetBoldIsBright vteTerm (boldIsBright curOpts)
terminalSetEnableSixelIfExists vteTerm (enableSixel curOpts)
terminalSetAllowBold vteTerm (allowBold curOpts)

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-20.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-22.04

In the use of ‘terminalSetAllowBold’

Check warning on line 395 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-22.04

In the use of ‘terminalSetAllowBold’
widgetShow vteTerm
pure vteTerm

Expand All @@ -404,7 +412,7 @@
let argv = maybe ["/usr/bin/env", "bash"] pure mShell
-- Launch the shell
shellPid <-
terminalSpawnSync

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-20.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-22.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-22.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-20.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-20.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.2.8 / ubuntu-20.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-8.10.7 / ubuntu-22.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.4.7 / ubuntu-20.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-20.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / cabal / ghc-9.0.2 / ubuntu-22.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-22.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack.yaml / ubuntu-22.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-22.04

In the use of ‘terminalSpawnSync’

Check warning on line 415 in src/Termonad/Term.hs

View workflow job for this annotation

GitHub Actions / stack --stack-yaml ./stack-nightly.yaml / ubuntu-22.04

In the use of ‘terminalSpawnSync’
vteTerm
[PtyFlagsDefault]
maybeCurrDir
Expand Down
2 changes: 0 additions & 2 deletions src/Termonad/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module Termonad.Types where
import Termonad.Prelude

import Control.Lens (ifoldMap)
import Control.Monad.Fail (fail)
import Data.FocusList (FocusList, emptyFL, getFocusItemFL, lengthFL)
import Data.Foldable (toList)
import Data.Unique (Unique, hashUnique, newUnique)
Expand All @@ -32,7 +31,6 @@ import GI.Vte (Terminal, CursorBlinkMode(..))
import Termonad.Gtk (widgetEq)
import Termonad.IdMap (IdMap, IdMapKey, singletonIdMap, lookupIdMap)
import Text.Pretty.Simple (pPrint)
import Text.Show (ShowS, showParen, showString)

-- | A wrapper around a VTE 'Terminal'. This also stores the process ID of the
-- process running on this terminal, as well as a 'Unique' that can be used for
Expand Down
Loading