Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMD: With multiline commands, only the first line is executed #306

Open
Taitava opened this issue Dec 17, 2022 · 5 comments
Open

CMD: With multiline commands, only the first line is executed #306

Taitava opened this issue Dec 17, 2022 · 5 comments

Comments

@Taitava
Copy link
Owner

Taitava commented Dec 17, 2022

Example command:

echo "First line"
echo "Second line"
echo "Third line"

OInly the first line is echoed. Then again, this works:

echo "First line" & echo "Second line" & echo "Third line"
@Taitava Taitava added bug Something isn't working affects/Windows For issues that do not affect all operating systems. affects/0.16.x affects/0.13.0 affects/0.14.0 affects/0.15.0 affects/0.17.0 labels Dec 17, 2022
@Taitava Taitava changed the title CMD: Multiline commands do not work at all CMD: With multiline commands, only the first line is executed Dec 17, 2022
@Taitava
Copy link
Owner Author

Taitava commented Dec 17, 2022

I posted a question about this on Stack Overflow: https://stackoverflow.com/questions/74836080/node-js-child-process-exec-with-cmd-exe-only-the-first-line-is-executed

I'm not even certain if this is a bug of SC. I tried to make sure CMD is passed CRLF newlines instead of LF newlines, but even that did not work. I'll keep this marked as a bug for now, but might change it later.

If no solution will be found for this, I'll probably just add a warning text to the textarea of every CMD shell command telling that newlines do not work.

Taitava added a commit that referenced this issue Dec 18, 2022
…riable parsing.

If I ever get #306 solved, it might utilize this ability in a way that would convert linebreaks into something that works for CMD.EXE.

This commit can also be used if the augmenting functionality is needed for something else than #306. For now, I'm not going to merge it to main before there's a practical need for it.
@Taitava Taitava added this to the 0.19.0 milestone Dec 19, 2022
@Taitava
Copy link
Owner Author

Taitava commented Dec 19, 2022

I added this to 0.19.0 because it will also have #297 which touches the same parts of code as this issue.

@ReaderGuy42
Copy link

Hi, I have a related question, I think. I'm trying to run
xdotool key ctrl+a & xdotool key ctrl+c & xdotool key ctrl+g, but I don't think it's working. Ctrl+g here is the quote word count that I was trying to get going the other day, and in order to count ALL words in a longer note it needs to be cached or something via Ctrl+A (select all), Ctrl+C (Copy).

If I just run Ctrl+g in ShellCommands, the pop up from this custom quote counter plugin comes up. But Ctrl+A on its own does not work. Just trying to streamline this process.

Any ideas? Thanks :)

@Taitava
Copy link
Owner Author

Taitava commented Dec 30, 2022

Hi @ReaderGuy42, this issue does not actually relate to your problem, as this is about Window's CMD.EXE, and you seem to be using Bash. So the multiline problem described in this issue should not affect you.

In order to keep this issue related to its actual topic, I replied to your question in the earlier discussion you started, although my answer is not very helpful. But we can continue discussion there and try to find a solution. 👍

@Taitava
Copy link
Owner Author

Taitava commented May 27, 2023

I added this to 0.19.0 because it will also have #297 which touches the same parts of code as this issue.

I'm confused why I did put this issue to milestone 0.19.0. This is not released in 0.19.0 and I don't know if I'll ever find a fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants