gtoolkit icon indicating copy to clipboard operation
gtoolkit copied to clipboard

Use `OSPlatform current lineEnding` when 'Enter' is pressed in file editors

Open botwhytho opened this issue 2 years ago • 2 comments

More context on Discord thread. Basically multi-line strings created in Gt that are used as input to bash may not work as expected as bash won't recognize the newlines correctly where it needs to. Not the first time I've bumped into issues with this, but this one has been the most frustrating time. I've seen issues looking at .st files in other IDEs because of the newline characters Pharo/Gt seem to use. Might have encountered other issues but don't remember the specifics.

botwhytho avatar Oct 12 '23 10:10 botwhytho

We should only do that in the file editor (such as in the one from FileReference)

girba avatar Oct 12 '23 18:10 girba

After thinking about the downstream effects, it is more reasonable to reduce the scope of this.

I already added an extensions method withOSLineEndings both on String and on GtExternalProcessBuilder (which modifies all arguments by sending that string method to them). It would be useful for others if these methods, which are opt-in and not the default behaviour. would be added to Gt. Having that method with some comment on GtExternalProcessBuilder may prevent future head scratching in scenarios like the one I describe above.

botwhytho avatar Oct 12 '23 20:10 botwhytho