Hello! I am a maintainer of Haskeletor (a modern fork of the late intellij-haskell), an IntelliJ pluign for Haskell, which mainly relies on Stack as the build system for the user projects.
When building a project (or installing a tool, say hlint or Hoogle) using Stack, the plugin executes commands like stack build or stack install, and it needs to present the build progress in the IDE UI.
Stack has some options to control how it exposes the progress to the user (the --progress-bar option), but none of these options actually work if we run Stack without a PTY (see the corresponding code: it relies on terminal variable that essentially checks for PTY). So, the IDE plugin has to either run Stack in PTY mode and deal with various related issues (parsing PTY output is hard and very unreliable, especially on platofms like Windows), or just show "indeterminate" progress when performing Stack operations.
Both approaches are non-ideal.
So, I propose for Stack to have some new option or an environment variable (which would be more appropriate?) to emit progress messages even in non-PTY mode, for improved external tool integration.
I have created the original ticket on intellij-haskell, but it took me a few years to recognize that we cannot do what I want without some small adjustments in Stack.
I would also consider any other ideas for better progress communication, such as emitting the progress info in a more structured way via socket or whatnot. But seriously though, I think the easiest way to unblock the progress indication in various editors and agents is to just allow emitting the same information that currently flows into the PTY, and let the parent process to parse it.
Hello! I am a maintainer of Haskeletor (a modern fork of the late intellij-haskell), an IntelliJ pluign for Haskell, which mainly relies on Stack as the build system for the user projects.
When building a project (or installing a tool, say hlint or Hoogle) using Stack, the plugin executes commands like
stack buildorstack install, and it needs to present the build progress in the IDE UI.Stack has some options to control how it exposes the progress to the user (the
--progress-baroption), but none of these options actually work if we run Stack without a PTY (see the corresponding code: it relies onterminalvariable that essentially checks for PTY). So, the IDE plugin has to either run Stack in PTY mode and deal with various related issues (parsing PTY output is hard and very unreliable, especially on platofms like Windows), or just show "indeterminate" progress when performing Stack operations.Both approaches are non-ideal.
So, I propose for Stack to have some new option or an environment variable (which would be more appropriate?) to emit progress messages even in non-PTY mode, for improved external tool integration.
I have created the original ticket on intellij-haskell, but it took me a few years to recognize that we cannot do what I want without some small adjustments in Stack.
I would also consider any other ideas for better progress communication, such as emitting the progress info in a more structured way via socket or whatnot. But seriously though, I think the easiest way to unblock the progress indication in various editors and agents is to just allow emitting the same information that currently flows into the PTY, and let the parent process to parse it.