filter out control characters and quote filenames
Searched for uses of putStr and hPutStr and changed appropriate ones to filter out control characters and quote filenames. This notably does not make find and findkeys quote filenames in their default output. Because they should only do that when stdout is non a pipe. A few commands like calckey and lookupkey seem too low-level to make sense to filter output, so skipped those. Also when relaying output from other commands that is not progress output, have git-annex filter out control characters. Sponsored-by: k0ld on Patreon
This commit is contained in:
parent
11e89c5a29
commit
df6f9f1ee8
15 changed files with 75 additions and 39 deletions
|
@ -23,6 +23,7 @@ import Utility.InodeCache
|
|||
import qualified Messages.JSON as JSON
|
||||
import Messages.Concurrent
|
||||
import Messages.Internal
|
||||
import Utility.SafeOutput
|
||||
|
||||
import qualified System.Console.Regions as Regions
|
||||
import qualified System.Console.Concurrent as Console
|
||||
|
@ -220,5 +221,5 @@ mkStderrEmitter :: Annex (String -> IO ())
|
|||
mkStderrEmitter = withMessageState go
|
||||
where
|
||||
go s
|
||||
| concurrentOutputEnabled s = return Console.errorConcurrent
|
||||
| otherwise = return (hPutStrLn stderr)
|
||||
| concurrentOutputEnabled s = return (Console.errorConcurrent . safeOutput)
|
||||
| otherwise = return (hPutStrLn stderr . safeOutput)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue