clear regions before ssh prompt
When built with concurrent-output 1.9, ssh password prompts will no longer interfere with the -J display. To avoid flicker, only done when ssh actually does need to prompt; ssh is first run in batch mode and if that succeeds the connection is up and no need to clear regions. This commit was supported by the NSF-funded DataLad project.
This commit is contained in:
parent
89f9be3230
commit
1d45e47e3f
5 changed files with 52 additions and 14 deletions
12
Messages.hs
12
Messages.hs
|
@ -56,6 +56,7 @@ import Types.Messages
|
|||
import Types.ActionItem
|
||||
import Types.Concurrency
|
||||
import Messages.Internal
|
||||
import Messages.Concurrent
|
||||
import qualified Messages.JSON as JSON
|
||||
import qualified Annex
|
||||
|
||||
|
@ -227,10 +228,13 @@ implicitMessage = whenM (implicitMessages <$> Annex.getState Annex.output)
|
|||
- that the action is the only thing using the console, and can eg prompt
|
||||
- the user.
|
||||
-}
|
||||
prompt :: (Concurrency -> Annex a) -> Annex a
|
||||
prompt :: Annex a -> Annex a
|
||||
prompt a = go =<< Annex.getState Annex.concurrency
|
||||
where
|
||||
go NonConcurrent = a NonConcurrent
|
||||
go c@(Concurrent {}) = withMessageState $ \s -> do
|
||||
go NonConcurrent = a
|
||||
go (Concurrent {}) = withMessageState $ \s -> do
|
||||
let l = promptLock s
|
||||
bracketIO (takeMVar l) (putMVar l) (const (a c))
|
||||
bracketIO
|
||||
(takeMVar l)
|
||||
(putMVar l)
|
||||
(const $ hideRegionsWhile a)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue