brick 2.3.1 → 2.3.2
raw patch · 6 files changed
+140/−51 lines, 6 filesdep +unixdep ~basedep ~microlensdep ~vtynew-component:exe:brick-unix-suspend-demoPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: unix
Dependency ranges changed: base, microlens, vty
API changes (from Hackage documentation)
- Brick.BorderMap: eBottomL :: forall a_agkc. Lens' (Edges a_agkc) a_agkc
+ Brick.BorderMap: eBottomL :: forall a_agvz. Lens' (Edges a_agvz) a_agvz
- Brick.BorderMap: eLeftL :: forall a_agkc. Lens' (Edges a_agkc) a_agkc
+ Brick.BorderMap: eLeftL :: forall a_agvz. Lens' (Edges a_agvz) a_agvz
- Brick.BorderMap: eRightL :: forall a_agkc. Lens' (Edges a_agkc) a_agkc
+ Brick.BorderMap: eRightL :: forall a_agvz. Lens' (Edges a_agvz) a_agvz
- Brick.BorderMap: eTopL :: forall a_agkc. Lens' (Edges a_agkc) a_agkc
+ Brick.BorderMap: eTopL :: forall a_agvz. Lens' (Edges a_agvz) a_agvz
- Brick.Types: availHeightL :: forall n_awyf. Lens' (Context n_awyf) Int
+ Brick.Types: availHeightL :: forall n_awKS. Lens' (Context n_awKS) Int
- Brick.Types: availWidthL :: forall n_awyf. Lens' (Context n_awyf) Int
+ Brick.Types: availWidthL :: forall n_awKS. Lens' (Context n_awKS) Int
- Brick.Types: bordersL :: forall n_awyj. Lens' (Result n_awyj) (BorderMap DynBorder)
+ Brick.Types: bordersL :: forall n_awKW. Lens' (Result n_awKW) (BorderMap DynBorder)
- Brick.Types: ctxAttrMapL :: forall n_awyf. Lens' (Context n_awyf) AttrMap
+ Brick.Types: ctxAttrMapL :: forall n_awKS. Lens' (Context n_awKS) AttrMap
- Brick.Types: ctxAttrNameL :: forall n_awyf. Lens' (Context n_awyf) AttrName
+ Brick.Types: ctxAttrNameL :: forall n_awKS. Lens' (Context n_awKS) AttrName
- Brick.Types: ctxBorderStyleL :: forall n_awyf. Lens' (Context n_awyf) BorderStyle
+ Brick.Types: ctxBorderStyleL :: forall n_awKS. Lens' (Context n_awKS) BorderStyle
- Brick.Types: ctxDynBordersL :: forall n_awyf. Lens' (Context n_awyf) Bool
+ Brick.Types: ctxDynBordersL :: forall n_awKS. Lens' (Context n_awKS) Bool
- Brick.Types: ctxHScrollBarOrientationL :: forall n_awyf. Lens' (Context n_awyf) (Maybe HScrollBarOrientation)
+ Brick.Types: ctxHScrollBarOrientationL :: forall n_awKS. Lens' (Context n_awKS) (Maybe HScrollBarOrientation)
- Brick.Types: ctxHScrollBarRendererL :: forall n_awyf. Lens' (Context n_awyf) (Maybe (HScrollbarRenderer n_awyf))
+ Brick.Types: ctxHScrollBarRendererL :: forall n_awKS. Lens' (Context n_awKS) (Maybe (HScrollbarRenderer n_awKS))
- Brick.Types: ctxVScrollBarOrientationL :: forall n_awyf. Lens' (Context n_awyf) (Maybe VScrollBarOrientation)
+ Brick.Types: ctxVScrollBarOrientationL :: forall n_awKS. Lens' (Context n_awKS) (Maybe VScrollBarOrientation)
- Brick.Types: ctxVScrollBarRendererL :: forall n_awyf. Lens' (Context n_awyf) (Maybe (VScrollbarRenderer n_awyf))
+ Brick.Types: ctxVScrollBarRendererL :: forall n_awKS. Lens' (Context n_awKS) (Maybe (VScrollbarRenderer n_awKS))
- Brick.Types: cursorLocationL :: forall n_awyk. Lens' (CursorLocation n_awyk) Location
+ Brick.Types: cursorLocationL :: forall n_awKX. Lens' (CursorLocation n_awKX) Location
- Brick.Types: cursorLocationNameL :: forall n_awyk n_az7W. Lens (CursorLocation n_awyk) (CursorLocation n_az7W) (Maybe n_awyk) (Maybe n_az7W)
+ Brick.Types: cursorLocationNameL :: forall n_awKX n_azkz. Lens (CursorLocation n_awKX) (CursorLocation n_azkz) (Maybe n_awKX) (Maybe n_azkz)
- Brick.Types: cursorsL :: forall n_awyj. Lens' (Result n_awyj) [CursorLocation n_awyj]
+ Brick.Types: cursorsL :: forall n_awKW. Lens' (Result n_awKW) [CursorLocation n_awKW]
- Brick.Types: eBottomL :: forall a_agkc. Lens' (Edges a_agkc) a_agkc
+ Brick.Types: eBottomL :: forall a_agvz. Lens' (Edges a_agvz) a_agvz
- Brick.Types: eLeftL :: forall a_agkc. Lens' (Edges a_agkc) a_agkc
+ Brick.Types: eLeftL :: forall a_agvz. Lens' (Edges a_agvz) a_agvz
- Brick.Types: eRightL :: forall a_agkc. Lens' (Edges a_agkc) a_agkc
+ Brick.Types: eRightL :: forall a_agvz. Lens' (Edges a_agvz) a_agvz
- Brick.Types: eTopL :: forall a_agkc. Lens' (Edges a_agkc) a_agkc
+ Brick.Types: eTopL :: forall a_agvz. Lens' (Edges a_agvz) a_agvz
- Brick.Types: extentsL :: forall n_awyj. Lens' (Result n_awyj) [Extent n_awyj]
+ Brick.Types: extentsL :: forall n_awKW. Lens' (Result n_awKW) [Extent n_awKW]
- Brick.Types: imageL :: forall n_awyj. Lens' (Result n_awyj) Image
+ Brick.Types: imageL :: forall n_awKW. Lens' (Result n_awKW) Image
- Brick.Types: visibilityRequestsL :: forall n_awyj. Lens' (Result n_awyj) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_awKW. Lens' (Result n_awKW) [VisibilityRequest]
- Brick.Types: windowHeightL :: forall n_awyf. Lens' (Context n_awyf) Int
+ Brick.Types: windowHeightL :: forall n_awKS. Lens' (Context n_awKS) Int
- Brick.Types: windowWidthL :: forall n_awyf. Lens' (Context n_awyf) Int
+ Brick.Types: windowWidthL :: forall n_awKS. Lens' (Context n_awKS) Int
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1rji n_a1rjj a_a1rkg. Lens (Dialog a_a1rji n_a1rjj) (Dialog a_a1rkg n_a1rjj) [(String, n_a1rjj, a_a1rji)] [(String, n_a1rjj, a_a1rkg)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1rvQ n_a1rvR a_a1rwO. Lens (Dialog a_a1rvQ n_a1rvR) (Dialog a_a1rwO n_a1rvR) [(String, n_a1rvR, a_a1rvQ)] [(String, n_a1rvR, a_a1rwO)]
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a1rji n_a1rjj. Lens' (Dialog a_a1rji n_a1rjj) (Maybe (Widget n_a1rjj))
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a1rvQ n_a1rvR. Lens' (Dialog a_a1rvQ n_a1rvR) (Maybe (Widget n_a1rvR))
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a1rji n_a1rjj. Lens' (Dialog a_a1rji n_a1rjj) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a1rvQ n_a1rvR. Lens' (Dialog a_a1rvQ n_a1rvR) Int
- Brick.Widgets.Edit: editContentsL :: forall t_a1jrQ n_a1jrR t_a1jsB. Lens (Editor t_a1jrQ n_a1jrR) (Editor t_a1jsB n_a1jrR) (TextZipper t_a1jrQ) (TextZipper t_a1jsB)
+ Brick.Widgets.Edit: editContentsL :: forall t_a1jEt n_a1jEu t_a1jFe. Lens (Editor t_a1jEt n_a1jEu) (Editor t_a1jFe n_a1jEu) (TextZipper t_a1jEt) (TextZipper t_a1jFe)
- Brick.Widgets.FileBrowser: fileBrowserEntriesG :: forall n_a1E1D. SimpleGetter (FileBrowser n_a1E1D) (List n_a1E1D FileInfo)
+ Brick.Widgets.FileBrowser: fileBrowserEntriesG :: forall n_a1Eeb. SimpleGetter (FileBrowser n_a1Eeb) (List n_a1Eeb FileInfo)
- Brick.Widgets.FileBrowser: fileBrowserEntryFilterG :: forall n_a1E1D. SimpleGetter (FileBrowser n_a1E1D) (Maybe (FileInfo -> Bool))
+ Brick.Widgets.FileBrowser: fileBrowserEntryFilterG :: forall n_a1Eeb. SimpleGetter (FileBrowser n_a1Eeb) (Maybe (FileInfo -> Bool))
- Brick.Widgets.FileBrowser: fileBrowserExceptionG :: forall n_a1E1D. SimpleGetter (FileBrowser n_a1E1D) (Maybe IOException)
+ Brick.Widgets.FileBrowser: fileBrowserExceptionG :: forall n_a1Eeb. SimpleGetter (FileBrowser n_a1Eeb) (Maybe IOException)
- Brick.Widgets.FileBrowser: fileBrowserLatestResultsG :: forall n_a1E1D. SimpleGetter (FileBrowser n_a1E1D) [FileInfo]
+ Brick.Widgets.FileBrowser: fileBrowserLatestResultsG :: forall n_a1Eeb. SimpleGetter (FileBrowser n_a1Eeb) [FileInfo]
- Brick.Widgets.FileBrowser: fileBrowserNameG :: forall n_a1E1D. SimpleGetter (FileBrowser n_a1E1D) n_a1E1D
+ Brick.Widgets.FileBrowser: fileBrowserNameG :: forall n_a1Eeb. SimpleGetter (FileBrowser n_a1Eeb) n_a1Eeb
- Brick.Widgets.FileBrowser: fileBrowserSearchStringG :: forall n_a1E1D. SimpleGetter (FileBrowser n_a1E1D) (Maybe Text)
+ Brick.Widgets.FileBrowser: fileBrowserSearchStringG :: forall n_a1Eeb. SimpleGetter (FileBrowser n_a1Eeb) (Maybe Text)
- Brick.Widgets.FileBrowser: fileBrowserSelectableG :: forall n_a1E1D. SimpleGetter (FileBrowser n_a1E1D) (FileInfo -> Bool)
+ Brick.Widgets.FileBrowser: fileBrowserSelectableG :: forall n_a1Eeb. SimpleGetter (FileBrowser n_a1Eeb) (FileInfo -> Bool)
- Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1E1D. Lens' (FileBrowser n_a1E1D) (FileInfo -> Bool)
+ Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1Eeb. Lens' (FileBrowser n_a1Eeb) (FileInfo -> Bool)
- Brick.Widgets.FileBrowser: fileBrowserSelectedFilesG :: forall n_a1E1D. SimpleGetter (FileBrowser n_a1E1D) (Set String)
+ Brick.Widgets.FileBrowser: fileBrowserSelectedFilesG :: forall n_a1Eeb. SimpleGetter (FileBrowser n_a1Eeb) (Set String)
- Brick.Widgets.FileBrowser: fileBrowserWorkingDirectoryG :: forall n_a1E1D. SimpleGetter (FileBrowser n_a1E1D) FilePath
+ Brick.Widgets.FileBrowser: fileBrowserWorkingDirectoryG :: forall n_a1Eeb. SimpleGetter (FileBrowser n_a1Eeb) FilePath
- Brick.Widgets.List: listElementsL :: forall n_a1xEK t_a1xEL e_a1xEM t_a1xUl e_a1xUm. Lens (GenericList n_a1xEK t_a1xEL e_a1xEM) (GenericList n_a1xEK t_a1xUl e_a1xUm) (t_a1xEL e_a1xEM) (t_a1xUl e_a1xUm)
+ Brick.Widgets.List: listElementsL :: forall n_a1xRi t_a1xRj e_a1xRk t_a1y6T e_a1y6U. Lens (GenericList n_a1xRi t_a1xRj e_a1xRk) (GenericList n_a1xRi t_a1y6T e_a1y6U) (t_a1xRj e_a1xRk) (t_a1y6T e_a1y6U)
- Brick.Widgets.List: listItemHeightL :: forall n_a1xEK t_a1xEL e_a1xEM. Lens' (GenericList n_a1xEK t_a1xEL e_a1xEM) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a1xRi t_a1xRj e_a1xRk. Lens' (GenericList n_a1xRi t_a1xRj e_a1xRk) Int
- Brick.Widgets.List: listNameL :: forall n_a1xEK t_a1xEL e_a1xEM n_a1xUn. Lens (GenericList n_a1xEK t_a1xEL e_a1xEM) (GenericList n_a1xUn t_a1xEL e_a1xEM) n_a1xEK n_a1xUn
+ Brick.Widgets.List: listNameL :: forall n_a1xRi t_a1xRj e_a1xRk n_a1y6V. Lens (GenericList n_a1xRi t_a1xRj e_a1xRk) (GenericList n_a1y6V t_a1xRj e_a1xRk) n_a1xRi n_a1y6V
- Brick.Widgets.List: listSelectedL :: forall n_a1xEK t_a1xEL e_a1xEM. Lens' (GenericList n_a1xEK t_a1xEL e_a1xEM) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a1xRi t_a1xRj e_a1xRk. Lens' (GenericList n_a1xRi t_a1xRj e_a1xRk) (Maybe Int)
Files
- CHANGELOG.md +14/−0
- README.md +40/−38
- brick.cabal +28/−3
- programs/UnixSuspendDemo.hs +33/−0
- src/Brick/Keybindings/Pretty.hs +7/−8
- src/Brick/Widgets/FileBrowser.hs +18/−2
CHANGELOG.md view
@@ -2,6 +2,20 @@ Brick changelog --------------- +2.3.2+-----++Bug fixes:+* `FileBrowser`: if the `FileBrowser` was initialized with a `FilePath`+ that ended in a slash, then if the user hit `Enter` on the `../` entry+ to move to the parent directory, the only effect was the removal of+ that trailing slash. This change trims the trailing slash so that the+ expected move occurs whenever the `../` entry is selected.+* `Brick.Keybindings.Pretty.keybindingHelpWidget`: fixed a problem where+ a key event with no name in a `KeyEvents` would cause a `fromJust`+ exception. The pretty-printer now falls back to a placeholder+ representation for such unnamed key events.+ 2.3.1 -----
README.md view
@@ -50,54 +50,56 @@ | Project | Description | | ------- | ----------- |-| [`tetris`](https://github.com/SamTay/tetris) | An implementation of the Tetris game |-| [`gotta-go-fast`](https://github.com/callum-oakley/gotta-go-fast) | A typing tutor |-| [`haskell-player`](https://github.com/potomak/haskell-player) | An `afplay` frontend |-| [`mushu`](https://github.com/elaye/mushu) | An `MPD` client |-| [`matterhorn`](https://github.com/matterhorn-chat/matterhorn) | A client for [Mattermost](https://about.mattermost.com/) |-| [`viewprof`](https://github.com/maoe/viewprof) | A GHC profile viewer |-| [`tart`](https://github.com/jtdaugherty/tart) | A mouse-driven ASCII art drawing program |-| [`silly-joy`](https://github.com/rootmos/silly-joy) | An interpreter for Joy |-| [`herms`](https://github.com/jackkiefer/herms) | A command-line tool for managing kitchen recipes |-| [`purebred`](https://github.com/purebred-mua/purebred) | A mail user agent | | [`2048Haskell`](https://github.com/8Gitbrix/2048Haskell) | An implementation of the 2048 game |+| [`babel-cards`](https://github.com/srhoulam/babel-cards) | A TUI spaced-repetition memorization tool. Similar to Anki. | | [`bhoogle`](https://github.com/andrevdm/bhoogle) | A [Hoogle](https://www.haskell.org/hoogle/) client |+| [`brewsage`](https://github.com/gerdreiss/brewsage#readme) | A TUI for Homebrew |+| [`brick-trading-journal`](https://codeberg.org/amano.kenji/brick-trading-journal) | A TUI program that calculates basic statistics from trades |+| [`Brickudoku`](https://github.com/Thecentury/brickudoku) | A hybrid of Tetris and Sudoku |+| [`cbookview`](https://github.com/mlang/chessIO) | A TUI for exploring polyglot chess opening book files | | [`clifm`](https://github.com/pasqu4le/clifm) | A file manager |-| [`towerHanoi`](https://github.com/shajenM/projects/tree/master/towerHanoi) | Animated solutions to The Tower of Hanoi |-| [`VOIDSPACE`](https://github.com/ChrisPenner/void-space) | A space-themed typing-tutor game |-| [`solitaire`](https://github.com/ambuc/solitaire) | The card game |-| [`sudoku-tui`](https://github.com/evanrelf/sudoku-tui) | A Sudoku implementation |-| [`summoner-tui`](https://github.com/kowainik/summoner/tree/master/summoner-tui) | An interactive frontend to the Summoner tool |-| [`wrapping-editor`](https://github.com/ta0kira/wrapping-editor) | An embeddable editor with support for Brick |+| [`codenames-haskell`](https://github.com/VigneshN1997/codenames-haskell) | An implementation of the Codenames game |+| [`fifteen`](https://github.com/benjaminselfridge/fifteen) | An implementation of the [15 puzzle](https://en.wikipedia.org/wiki/15_puzzle) |+| [`ghcup`](https://www.haskell.org/ghcup/) | A TUI for `ghcup`, the Haskell toolchain manager | | [`git-brunch`](https://github.com/andys8/git-brunch) | A git branch checkout utility |+| [`Giter`](https://gitlab.com/refaelsh/giter) | A UI wrapper around Git CLI inspired by [Magit](https://magit.vc/). |+| [`gotta-go-fast`](https://github.com/callum-oakley/gotta-go-fast) | A typing tutor |+| [`haradict`](https://github.com/srhoulam/haradict) | A TUI Arabic dictionary powered by [ElixirFM](https://github.com/otakar-smrz/elixir-fm) | | [`hascard`](https://github.com/Yvee1/hascard) | A program for reviewing "flash card" notes |-| [`ttyme`](https://github.com/evuez/ttyme) | A TUI for [Harvest](https://www.getharvest.com/) |-| [`ghcup`](https://www.haskell.org/ghcup/) | A TUI for `ghcup`, the Haskell toolchain manager |-| [`cbookview`](https://github.com/mlang/chessIO) | A TUI for exploring polyglot chess opening book files |-| [`thock`](https://github.com/rmehri01/thock) | A modern TUI typing game featuring online racing against friends |-| [`fifteen`](https://github.com/benjaminselfridge/fifteen) | An implementation of the [15 puzzle](https://en.wikipedia.org/wiki/15_puzzle) |+| [`haskell-player`](https://github.com/potomak/haskell-player) | An `afplay` frontend |+| [`herms`](https://github.com/jackkiefer/herms) | A command-line tool for managing kitchen recipes |+| [`hic-hac-hoe`](https://github.com/blastwind/hic-hac-hoe) | Play tic tac toe in terminal! |+| [`hledger-iadd`](http://github.com/rootzlevel/hledger-iadd) | An interactive terminal UI for adding hledger journal entries |+| [`hledger-ui`](https://github.com/simonmichael/hledger) | A terminal UI for the hledger accounting system. |+| [`homodoro`](https://github.com/c0nradLC/homodoro) | A terminal application to use the pomodoro technique and keep track of daily tasks |+| [`htyper`](https://github.com/Simon-Hostettler/htyper) | A typing speed test program |+| [`hyahtzee2`](https://github.com/DamienCassou/hyahtzee2#readme) | Famous Yahtzee dice game |+| [`kpxhs`](https://github.com/akazukin5151/kpxhs) | An interactive [Keepass](https://github.com/keepassxreboot/keepassxc/) database viewer |+| [`matterhorn`](https://github.com/matterhorn-chat/matterhorn) | A client for [Mattermost](https://about.mattermost.com/) | | [`maze`](https://github.com/benjaminselfridge/maze) | A Brick-based maze game |+| [`monalog`](https://github.com/goosedb/Monalog) | Terminal logs observer |+| [`mushu`](https://github.com/elaye/mushu) | An `MPD` client |+| [`mywork`](https://github.com/kquick/mywork) [[Hackage]](https://hackage.haskell.org/package/mywork) | A tool to keep track of the projects you are working on | | [`pboy`](https://github.com/2mol/pboy) | A tiny PDF organizer |-| [`hyahtzee2`](https://github.com/DamienCassou/hyahtzee2#readme) | Famous Yahtzee dice game |-| [`brewsage`](https://github.com/gerdreiss/brewsage#readme) | A TUI for Homebrew |+| [`purebred`](https://github.com/purebred-mua/purebred) | A mail user agent | | [`sandwich`](https://codedownio.github.io/sandwich/) | A test framework with a TUI interface |-| [`youbrick`](https://github.com/florentc/youbrick) | A feed aggregator and launcher for Youtube channels |+| [`silly-joy`](https://github.com/rootmos/silly-joy) | An interpreter for Joy |+| [`solitaire`](https://github.com/ambuc/solitaire) | The card game |+| [`sudoku-tui`](https://github.com/evanrelf/sudoku-tui) | A Sudoku implementation |+| [`summoner-tui`](https://github.com/kowainik/summoner/tree/master/summoner-tui) | An interactive frontend to the Summoner tool | | [`swarm`](https://github.com/byorgey/swarm/) | A 2D programming and resource gathering game |-| [`hledger-ui`](https://github.com/simonmichael/hledger) | A terminal UI for the hledger accounting system. |-| [`hledger-iadd`](http://github.com/rootzlevel/hledger-iadd) | An interactive terminal UI for adding hledger journal entries |-| [`wordle`](https://github.com/ivanjermakov/wordle) | An implementation of the Wordle game |-| [`kpxhs`](https://github.com/akazukin5151/kpxhs) | An interactive [Keepass](https://github.com/keepassxreboot/keepassxc/) database viewer |-| [`htyper`](https://github.com/Simon-Hostettler/htyper) | A typing speed test program |-| [`ullekha`](https://github.com/ajithnn/ullekha) | An interactive terminal notes/todo app with file/redis persistence |-| [`mywork`](https://github.com/kquick/mywork) [[Hackage]](https://hackage.haskell.org/package/mywork) | A tool to keep track of the projects you are working on |-| [`hic-hac-hoe`](https://github.com/blastwind/hic-hac-hoe) | Play tic tac toe in terminal! |-| [`babel-cards`](https://github.com/srhoulam/babel-cards) | A TUI spaced-repetition memorization tool. Similar to Anki. |-| [`codenames-haskell`](https://github.com/VigneshN1997/codenames-haskell) | An implementation of the Codenames game |-| [`haradict`](https://github.com/srhoulam/haradict) | A TUI Arabic dictionary powered by [ElixirFM](https://github.com/otakar-smrz/elixir-fm) |-| [`Giter`](https://gitlab.com/refaelsh/giter) | A UI wrapper around Git CLI inspired by [Magit](https://magit.vc/). |-| [`Brickudoku`](https://github.com/Thecentury/brickudoku) | A hybrid of Tetris and Sudoku |+| [`tart`](https://github.com/jtdaugherty/tart) | A mouse-driven ASCII art drawing program |+| [`tetris`](https://github.com/SamTay/tetris) | An implementation of the Tetris game |+| [`thock`](https://github.com/rmehri01/thock) | A modern TUI typing game featuring online racing against friends | | [`timeloop`](https://github.com/cdupont/timeloop) | A time-travelling demonstrator |-| [`brick-trading-journal`](https://codeberg.org/amano.kenji/brick-trading-journal) | A TUI program that calculates basic statistics from trades |+| [`towerHanoi`](https://github.com/shajenM/projects/tree/master/towerHanoi) | Animated solutions to The Tower of Hanoi |+| [`ttyme`](https://github.com/evuez/ttyme) | A TUI for [Harvest](https://www.getharvest.com/) |+| [`ullekha`](https://github.com/ajithnn/ullekha) | An interactive terminal notes/todo app with file/redis persistence |+| [`viewprof`](https://github.com/maoe/viewprof) | A GHC profile viewer |+| [`VOIDSPACE`](https://github.com/ChrisPenner/void-space) | A space-themed typing-tutor game |+| [`wordle`](https://github.com/ivanjermakov/wordle) | An implementation of the Wordle game |+| [`wrapping-editor`](https://github.com/ta0kira/wrapping-editor) | An embeddable editor with support for Brick |+| [`youbrick`](https://github.com/florentc/youbrick) | A feed aggregator and launcher for Youtube channels | These third-party packages also extend `brick`:
brick.cabal view
@@ -1,5 +1,5 @@ name: brick-version: 2.3.1+version: 2.3.2 synopsis: A declarative terminal user interface library description: Write terminal user interfaces (TUIs) painlessly with 'brick'! You@@ -32,13 +32,22 @@ license-file: LICENSE author: Jonathan Daugherty <cygnus@foobox.com> maintainer: Jonathan Daugherty <cygnus@foobox.com>-copyright: (c) Jonathan Daugherty 2015-2023+copyright: (c) Jonathan Daugherty 2015-2024 category: Graphics build-type: Simple cabal-version: 1.18 Homepage: https://github.com/jtdaugherty/brick/ Bug-reports: https://github.com/jtdaugherty/brick/issues-tested-with: GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.4, GHC == 9.4.2+tested-with: GHC == 8.2.2+ || == 8.4.4+ || == 8.6.5+ || == 8.8.4+ || == 8.10.7+ || == 9.0.2+ || == 9.2.8+ || == 9.4.8+ || == 9.6.3+ || == 9.8.1 extra-doc-files: README.md, docs/guide.rst,@@ -483,6 +492,22 @@ vty, text, microlens++executable brick-unix-suspend-demo+ hs-source-dirs: programs+ ghc-options: -threaded -Wall -Wcompat -O2+ default-language: Haskell2010+ main-is: UnixSuspendDemo.hs+ build-depends: base,+ brick,+ vty,+ text,+ vector,+ mtl,+ microlens >= 0.3.0.0,+ microlens-th,+ microlens-mtl,+ unix executable brick-edit-demo if !flag(demos)
+ programs/UnixSuspendDemo.hs view
@@ -0,0 +1,33 @@+module Main where++import qualified Graphics.Vty as V++import qualified Brick.Main as M+import qualified Brick.Types as T+import Brick.Widgets.Core (str)+import qualified Brick.AttrMap as A+import System.Posix.Signals++drawUI :: () -> [T.Widget ()]+drawUI () = [str "Press C-z to suspend or any other key to quit"]++appEvent :: T.BrickEvent () e -> T.EventM () () ()+appEvent (T.VtyEvent (V.EvKey (V.KChar 'z') [V.MCtrl])) = do+ st <- T.get+ M.suspendAndResume $ do+ raiseSignal keyboardStop+ return st+appEvent _ =+ M.halt++theApp :: M.App () e ()+theApp =+ M.App { M.appDraw = drawUI+ , M.appChooseCursor = M.neverShowCursor+ , M.appHandleEvent = appEvent+ , M.appStartEvent = return ()+ , M.appAttrMap = const $ A.attrMap V.defAttr []+ }++main :: IO ()+main = M.defaultMain theApp ()
src/Brick/Keybindings/Pretty.hs view
@@ -25,7 +25,6 @@ import Brick import Data.List (sort, intersperse)-import Data.Maybe (fromJust) #if !(MIN_VERSION_base(4,11,0)) import Data.Monoid ((<>)) #endif@@ -124,19 +123,19 @@ ByKey b -> (Comment "(non-customizable key)", [Verbatim $ ppBinding b]) ByEvent ev ->- let name = fromJust $ keyEventName (keyConfigEvents kc) ev+ let name = maybe (Comment "(unnamed)") Verbatim $ keyEventName (keyConfigEvents kc) ev in case lookupKeyConfigBindings kc ev of Nothing -> if not (null (allDefaultBindings kc ev))- then (Verbatim name, Verbatim <$> ppBinding <$> allDefaultBindings kc ev)- else (Verbatim name, unbound)+ then (name, Verbatim <$> ppBinding <$> allDefaultBindings kc ev)+ else (name, unbound) Just Unbound ->- (Verbatim name, unbound)+ (name, unbound) Just (BindingList bs) -> let result = if not (null bs) then Verbatim <$> ppBinding <$> bs else unbound- in (Verbatim name, result)+ in (name, result) in (label, handlerDescription $ kehHandler h, evText) -- | Build a 'Widget' displaying key binding information for a single@@ -164,8 +163,8 @@ getText (Comment s) = s getText (Verbatim s) = s label = withDefAttr eventNameAttr $ case evName of- Comment s -> txt s -- TODO: was "; " <> s- Verbatim s -> txt s -- TODO: was: emph $ txt s+ Comment s -> txt s+ Verbatim s -> txt s in vBox [ withDefAttr eventDescriptionAttr $ txt desc , label <+> txt " = " <+> withDefAttr keybindingAttr (txt evText) ]
src/Brick/Widgets/FileBrowser.hs view
@@ -154,7 +154,7 @@ import Data.Monoid #endif import Data.Int (Int64)-import Data.List (sortBy, isSuffixOf)+import Data.List (sortBy, isSuffixOf, dropWhileEnd) import qualified Data.Set as Set import qualified Data.Vector as V import Lens.Micro@@ -282,7 +282,7 @@ -> IO (FileBrowser n) newFileBrowser selPredicate name mCwd = do initialCwd <- FP.normalise <$> case mCwd of- Just path -> return path+ Just path -> return $ removeTrailingSlash path Nothing -> D.getCurrentDirectory let b = FileBrowser { fileBrowserWorkingDirectory = initialCwd@@ -297,6 +297,22 @@ } setWorkingDirectory initialCwd b++-- | Removes any trailing slash(es) from the supplied FilePath (which should+-- indicate a directory). This does not remove a sole slash indicating the root+-- directory.+--+-- This is done because if the FileBrowser is initialized with an initial working+-- directory that ends in a slash, then selecting the "../" entry to move to the+-- parent directory will cause the removal of the trailing slash, but it will not+-- otherwise cause any change, misleading the user into thinking no action was+-- taken (the disappearance of the trailing slash is unlikely to be noticed).+-- All subsequent parent directory selection operations are processed normally,+-- and the 'fileBrowserWorkingDirectory' never ends in a trailing slash+-- thereafter (except at the root directory).+removeTrailingSlash :: FilePath -> FilePath+removeTrailingSlash "/" = "/"+removeTrailingSlash d = dropWhileEnd (== '/') d -- | A file entry selector that permits selection of all file entries -- except directories. Use this if you want users to be able to navigate