Sublime Forum

Linux wait flag inconsistent?

#1

How is the --wait flag supposed to work on linux? This is the behavior I’m seeing

-If sublime ISN’T running, launching sublime_text from the terminal WILL block until the new process exits, regardless of whether you use --wait or not.
-If sublime IS running, launching sublime_text from the terminal WON’T block, regardless of whether you use --wait or not.

This makes it seem like --wait isn’t doing anything. FWIW, I’m not seeing any libgio errors.

0 Likes

#2

I echo the problem. In the change log, it reads

“Windows: Added support for --wait”

But I cannot use it in Windows. It seems the Windows version (Build 2210) does not accept ANY argument.

In Linux, the --wait argument does not work. It would much better if we have both --nowait and --wait on Linux.

The use case for --nowait would be invoking ST from terminal. Unlike Vim, since ST does not have command line version, blocking the terminal is flaw.
For --wait, think about export EDITOR=" --wait" so that VCS can use ST as editor. In such cases, blocking is essential.

0 Likes

#3

Like virtually every other X program on Linux, if you run it from the terminal, the shell will block until the process has exited. If you don’t want that, consider launching it with an &.

–wait is only relevant on Linux if an instance is already running, as the default behavior in that scenario is to hand the file off to the existing instance and exit immediately.

0 Likes

#4

I think the problem for this thread is “consistency”, that is, always block or not block the terminal when using certain commands. I know we can write shell script to always use & to not block. But how to always block even there is a opened ST window? That is the OP’s original question.

My question is, --wait is not working in Windows. Maybe this is a (known) bug.

0 Likes