Skip to content

Commit

Permalink
Disable echo in daml wrapper script (#655)
Browse files Browse the repository at this point in the history
When echo is enabled (which is the default), the IDE can get really
confused since it tries to interpret the commands as LSP messages
which obviously fails.
  • Loading branch information
cocreature authored and mergify[bot] committed Apr 24, 2019
1 parent 7c72162 commit 1cc0126
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion daml-assistant/src/DAML/Assistant/Install.hs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ activateDaml env@InstallEnv{..} targetPath = do

requiredIO ("Failed to link daml binary in " <> pack damlBinaryTargetDir) $
if isWindows
then writeFile damlBinaryTargetPath (damlBinarySourcePath <> " %*")
then writeFile damlBinaryTargetPath $ unlines
[ "@echo off"
, damlBinarySourcePath <> " %*"
]
else createSymbolicLink damlBinarySourcePath damlBinaryTargetPath

unlessQuiet env $ do -- Ask user to add .daml/bin to PATH if it is absent.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ runServer loggerH reqHandler notifHandler notifChan = do
-- are not newline delimited.
hSetBuffering stdin NoBuffering
hSetBuffering newStdout NoBuffering
-- We don’t want any newline conversion or encoding on those handles.
hSetBinaryMode newStdout True
hSetBinaryMode stdin True
JsonRpc.runServer
loggerH
(sink newStdout) source
Expand Down

0 comments on commit 1cc0126

Please sign in to comment.