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

Fix image scroll for iterm2 #178

Closed
wants to merge 1 commit into from
Closed
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
16 changes: 10 additions & 6 deletions lib/Patat/Images/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ module Patat.Images.Internal


--------------------------------------------------------------------------------
import Control.Exception (Exception)
import qualified Data.Aeson as A
import Data.Data (Data)
import Data.Typeable (Typeable)
import Control.Exception (Exception)
import qualified Data.Aeson as A
import Data.Data (Data)
import qualified Data.List as L
import Data.Typeable (Typeable)
import Patat.Cleanup
import System.Environment
import qualified Data.List as L
import qualified System.IO as IO

--------------------------------------------------------------------------------
data Config a = Auto | Explicit a deriving (Eq)
Expand Down Expand Up @@ -48,4 +49,7 @@ withEscapeSequence f = do
let inScreen = maybe False ("screen" `L.isPrefixOf`) term
putStr $ if inScreen then "\ESCPtmux;\ESC\ESC]" else "\ESC]"
f
putStrLn $ if inScreen then "\a\ESC\\" else "\a"
putStr $ if inScreen then "\a\ESC\\" else "\a"
-- Make sure we don't print a newline after the image, or it may scroll
-- slightly out of view to the top. We flush instead.
IO.hFlush IO.stdout
Loading