Sublime Forum

Build 3095: run_command starts two processes

#1

OS: windows 7 32bit
plugin runs code

        self.window.run_command("exec", {
            "working_dir": questa_dir,
            "file_regex": self.get_pattern_parse_output(),
            "cmd": 'cmd'], # can be any process
            "shell": True
        })

and it starts two processes cmd.exe. In build 3083 works fine (one process).
Maybe something was changed in build system. Does anyone have the same issue?

0 Likes

#2

shell: True is what causes this.

0 Likes

#3

Tried to comment shell=True and to use shell=False, same result.
In plugin I use other process vsim.exe (can be any).

0 Likes

#4

Problem is trickier than I thought.

Plugin executes command

            self.window.run_command("exec", {
            "working_dir": questa_dir,
            "file_regex": self.get_pattern_parse_output(),
            "cmd": 'vsim', '-c', '-do', self.questa_script_path, '-quiet'],
        })

Actually process vsim executes TCL script smth like that one

# routine to show progress, prints dots
set old_time 0
proc printsimstate {} {
    global Now
    global old_time
    set cur_time $Now
    if { $old_time != $cur_time } {
        puts -nonewline stderr "$cur_time "
        set old_time $cur_time
    } else {
        puts -nonewline stderr "."
    }
    after 1000 printsimstate
}
printsimstate

vsim some arguments
quit -sim
# should exit script and start program in gui mode
exec vsim with arguments & 

In build 3083 works as expected, in 3095 it emits two processes, one of them keeps printing dots in console.

0 Likes

#5

Issue solved by adding one more vsim specific command at the end of TCL script

quit -f

Still the same code works differently, something was changed in console handler.

0 Likes