diff --git a/ChangeLog.md b/ChangeLog.md index 3861e15..cac2c68 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,11 +1,10 @@ # Revision history for reflex-vty -## Unreleased 0.5.1.1 - +## 0.5.2.0 +* Update to use latest version of vty (for cross-platform support) * Fix an issue where the cursor tag is not used for an empty string in `displayLineWithAlignment` ## 0.5.1.0 - * Change `inputInFocusedRegion` to filter mouse scroll wheel input based on if the region under than the mouse rather than using mouse drag tracking * Add MonadCatch, MonadThrow, and MonadMask instances (relies on reflex-0.9.2.0 or greater) diff --git a/dep/reflex-platform/github.json b/dep/reflex-platform/github.json index f23a0d2..e03dc51 100644 --- a/dep/reflex-platform/github.json +++ b/dep/reflex-platform/github.json @@ -1,8 +1,8 @@ { "owner": "reflex-frp", "repo": "reflex-platform", - "branch": "develop", + "branch": "release/1.2.0.0", "private": false, - "rev": "6c8830e059a6d2859cb1b65acefed3c2f1d216d3", - "sha256": "06kv45yq8qan0p22wzj5c9mx11ns1wddyqjr1xasjjkf6gaf0080" + "rev": "f231e2425ac92339b8491cdd970930d63d9ad1ad", + "sha256": "0b042x423p04shhidni08f47ydgpfj0rpqhb0m6gj2lg8b3s9l8k" } diff --git a/reflex-vty.cabal b/reflex-vty.cabal index 8b941d5..27b642a 100644 --- a/reflex-vty.cabal +++ b/reflex-vty.cabal @@ -1,5 +1,5 @@ name: reflex-vty -version: 0.5.1.1 +version: 0.5.2.0 synopsis: Reflex FRP host and widgets for VTY applications description: Build terminal applications using functional reactive programming (FRP) with Reflex FRP (). @@ -40,7 +40,7 @@ library , Reflex.Spider.Orphans , Control.Monad.NodeId build-depends: - base >= 4.10.0 && < 4.19, + base >= 4.10.0 && < 4.20, bimap >= 0.3.3 && < 0.6, containers >= 0.5.0 && < 0.7, mtl >= 2.2.2 && < 2.4, @@ -58,7 +58,8 @@ library ref-tf >= 0.4.0 && < 0.6, reflex >= 0.9.2 && < 1, time >= 1.8.0 && < 1.13, - vty >= 5.28 && < 5.39 + vty >= 6.0 && < 6.2, + vty-crossplatform >= 0.1 && < 0.5 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall diff --git a/release.nix b/release.nix index 48d8eef..f32d38f 100644 --- a/release.nix +++ b/release.nix @@ -1,16 +1,26 @@ { reflex-platform ? import ./dep/reflex-platform +, supportedSystems ? [ "x86_64-linux" "x86_64-darwin" ] }: let rp = reflex-platform {}; pkgs = rp.nixpkgs; - supportedSystems = [ "x86_64-linux" "x86_64-darwin" ]; inherit (pkgs) lib; haskellLib = pkgs.haskell.lib; commonOverrides = self: super: { vty = self.callHackageDirect { pkg = "vty"; - ver = "5.38"; - sha256 = "0kcd3ln9xmc62ka0i7habzvjjar8z63mlvl15rdhf8hqmda0b7r7"; + ver = "6.1"; + sha256 = "2cefcb5764f6b662440ba9e56c30282da37071b599a7def7fc8e5679f2602bf8"; + } {}; + vty-crossplatform = self.callHackageDirect { + pkg = "vty-crossplatform"; + ver = "0.4.0.0"; + sha256 = "7b72e71b7a2e1a947f825a44a1fdea2e3e147944410c4286390aa4124a56358b"; + } {}; + vty-unix = self.callHackageDirect { + pkg = "vty-unix"; + ver = "0.2.0.0"; + sha256 = "b03a315f1aa8f70e5e3aab36b88ed2e49cd646c56b1e34c195dae13c929ca926"; } {}; reflex = self.callCabal2nix "reflex" (rp.hackGet ./dep/reflex) {}; }; @@ -38,7 +48,7 @@ let }; }; nixGhc961 = (import ./dep/nixpkgs { inherit system; }).haskell.packages.ghc961.override { - overrides = self: super: { + overrides = self: super: commonOverrides self super // { reflex = self.callCabal2nix "reflex" (rp.hackGet ./dep/reflex) {}; @@ -75,17 +85,11 @@ let ver = "0.5"; sha256 = "02iyvrr7nd7fnivz78lzdchy8zw1cghqj1qx2yzbbb9869h1mny7"; } {}; - vty = self.callHackageDirect { - pkg = "vty"; - ver = "5.38"; - sha256 = "0kcd3ln9xmc62ka0i7habzvjjar8z63mlvl15rdhf8hqmda0b7r7"; - } {}; # Jailbroken until https://github.com/audreyt/string-qq/pull/3 string-qq = haskellLib.dontCheck super.string-qq; # Tests aren't compatible with transformers-0.6 - bimap = haskellLib.dontCheck super.bimap; exception-transformers = haskellLib.doJailbreak (haskellLib.dontCheck super.exception-transformers); }; diff --git a/src/Reflex/Vty/Host.hs b/src/Reflex/Vty/Host.hs index d1f61f5..e235648 100644 --- a/src/Reflex/Vty/Host.hs +++ b/src/Reflex/Vty/Host.hs @@ -30,6 +30,8 @@ import Reflex import Reflex.Host.Class import Reflex.Spider.Orphans () import qualified Graphics.Vty as V +import qualified Graphics.Vty.CrossPlatform as V + import Graphics.Vty (DisplayRegion) -- | A synonym for the underlying vty event type from 'Graphics.Vty'. This should @@ -230,5 +232,8 @@ runVtyApp app = do -- | Returns the standard vty configuration with mouse mode enabled. getDefaultVty :: IO V.Vty getDefaultVty = do - cfg <- V.standardIOConfig - V.mkVty $ cfg { V.mouseMode = Just True } + cfg <- V.userConfig + vty <- V.mkVty cfg + liftIO $ V.setMode (V.outputIface vty) V.Mouse True + return vty +