#562 TeXstudio portable starts a second time from Sumatra

None
open
nobody
None
1
2014-04-27
2013-07-23
Dirk
No

Hallo TeXstudio-Team,

I use Sumatra 2.3.2 as external viewer for my portable TeXstudio 2.6.2. As command to start Sumatra I tried:
"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe" -reuse-instance "%.pdf" -forward-search "%.tex" @
and
dde:///"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe":SUMATRA/control/[ForwardSearch("?am.pdf","?c:am.tex",@,0,0,1)]
From Sumatra I use:
"C:\<path>\texstudio.exe" "%f" -line %l

When viewing the pdf from TeXstudio, Sumatra starts and shows the correct position. However, a double click in Sumatra starts a second instance of TeXstudio and jumps to the position. Why does Sumatra starts TeXstudio a second time?
To work around this problem one can close the first instance of TeXstudio, which closes Sumatra too. After that it is possible to start Sumatra from TeXstudio again and switch between Sumatra and TeXstudio correctly.

Kind regards,
Dirk

Discussion

1 2 > >> (Page 1 of 2)
  • This may happen, if Sumatra changes the default temporary directory (TMP or TEMP environment variable) and then txs does not find the file saying it is running.

    If you call Help/Check Latex Installation, what does it list for the TMP, TEMP and LOCK_NAME_OVERRIDE... variables? In the normal txs and the one started by Sumatra

     
  • Dirk
    Dirk
    2013-07-26

    Normal txs:
    TEMP=C:\Users\<name>\AppData\Local\Temp
    LOCK_NAME_OVERRIDE_qtsingleapp_TeXstu_c959_1=C:/Users/<name>/AppData/Local/Temp/qtsingleapp-TeXstu-c959-1-lockfile

    txs from Sumatra:
    First an error occurs: Log File not found
    Than the System Report shows:
    TEMP=C:\Users\<name>\AppData\Local\Temp
    LOCK_NAME_OVERRIDE_qtsingleapp_TeXstu_c959_1=C:/Users/<name>/AppData/Local/Temp/qtsingleapp-TeXstu-c959-1-lockfile

    Kind regards
    Dirk

     
  • That looks okay.

    Then it is some other issue.
    But I cannot reproduce it.

    How do you start texstudio? Did you try the same command you set in Sumatra?

     
  • Dirk
    Dirk
    2013-08-02

    Hey Benito,

    I thought about it and notice, that I start TeXstudio with the "--start-always" option. Can you reproduce it with this option?

    All best
    Dirk

     
  • That's actually what the option is supposed to do.

    If you use --start-always it is not considered a running txs instance

     
  • Dirk
    Dirk
    2013-08-02

    However, I only use it to start TeXstudio when clicking a txs or txss file, not in the option of Sumatra.
    From the second instance, everything works as I expect.

     
  • because the 2nd instance is not started with the --start-always option

     
  • Dirk
    Dirk
    2013-08-02

    So starting TeXstudio a second time from Sumatra is the expected behaviour, if I start TeXstudio with --start-always? That sound a little bit weird to me.

     
  • if you start txs normally, then start another instance with --start-always, sumatra should open the file in the first instance, not in the 2nd one.

    Therefore it is never opening a file in an instance started with --start-always.

     
  • Dirk
    Dirk
    2013-08-02

    Than I have this problem with the second instance, haven´t I?
    I add the --start-always option to the registry of Windows, so it is not that easy to switch always the option.

    Do you think it is a bug or a feature?

     
1 2 > >> (Page 1 of 2)