terminal: allow trailing spaces in terminal commands (e.g., to drag and drop files) (#1467)

This commit is contained in:
Evgeny Poberezkin
2022-11-30 08:25:42 +00:00
committed by GitHub
parent ef1133ee98
commit eb81b62892
+2 -1
View File
@@ -27,6 +27,7 @@ import Data.Bifunctor (bimap, first)
import qualified Data.ByteString.Base64 as B64
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.Char (isSpace)
import Data.Either (fromRight)
import Data.Fixed (div')
import Data.Functor (($>))
@@ -227,7 +228,7 @@ execChatCommand s = case parseChatCommand s of
Right cmd -> either CRChatCmdError id <$> runExceptT (processChatCommand cmd)
parseChatCommand :: ByteString -> Either String ChatCommand
parseChatCommand = A.parseOnly chatCommandP
parseChatCommand = A.parseOnly chatCommandP . B.dropWhileEnd isSpace
toView :: ChatMonad m => ChatResponse -> m ()
toView event = do