Under Linux, "Find in Files" with a '$' character doesn't work

79 views
Skip to first unread message

Jingcheng Zhang

unread,
Sep 22, 2024, 2:33:34 AM9/22/24
to scite-interest
I cannot find a text with '$' in it, the result is invalid. But under windows it works correctly.
Seems the '$' is hijacked by linux shell which makes the problem. How to solve?
Thanks!

Neil Hodgson

unread,
Sep 30, 2024, 2:03:54 AM9/30/24
to scite-interest
Jingcheng Zhang:

I cannot find a text with '$' in it, the result is invalid. But under windows it works correctly.
Seems the '$' is hijacked by linux shell which makes the problem. How to solve?

On Linux, the Find in Files command works by running another SciTE process with the text provided as a command-line argument.

The '$' should be quoted with '\' to avoid shell interpretation so '\$'. This can be done in the Slash function.

Another problem is that there is an extra layer of variable interpretation for $(variable) in SciTEBase::Execute that should be avoided for this case.

It would likely be better to reimplement using threads instead of processes as is done for Windows and MacOS.

Neil

Jingcheng Zhang

unread,
Sep 30, 2024, 8:28:16 PM9/30/24
to scite-interest
Hi Neil,
I tried to search "\$2800", but the executed command becomes:

SciTE -grep ~~~~ "" "" "\\$2800"

The result is invalid, it adds another "\" character inside. But if I call SciTE in command line directly, it works:

SciTE -grep ~~~~ "" "" "\$2800"

This result is valid. So how can I remove the extra "\" character added by the Find in Files command?

godstech

unread,
Oct 1, 2024, 5:29:07 PM10/1/24
to scite-i...@googlegroups.com
Try single quotes to avoid interpolation:

SciTE -grep ~~~~ "" "" '$2800'


- Francisco 

-------- Mensaje original --------
De: Jingcheng Zhang <dio...@gmail.com>
Fecha: 30/9/2024 7:28 p. m. (GMT-06:00)
A: scite-interest <scite-i...@googlegroups.com>
Asunto: [scite] Re: Under Linux, "Find in Files" with a '$' character doesn't work

--
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scite-interes...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scite-interest/522a0c2f-3413-45a0-b502-8e4158c61873n%40googlegroups.com.

Neil Hodgson

unread,
Oct 1, 2024, 5:43:21 PM10/1/24
to scite-interest
Jingcheng Zhang::

I tried to search "\$2800", but the executed command becomes:

SciTE -grep ~~~~ "" "" "\\$2800"

   The Slash function protects the \ you entered by converting it to \\. This Slash function likely needs to change while not affecting other callers.


Try single quotes to avoid interpolation:

Unfortunately, replacing double quotes with single quotes in the code would make it difficult to search for single quotes.

Neil
Message has been deleted

Jingcheng Zhang

unread,
Feb 9, 2025, 10:01:08 AMFeb 9
to scite-interest
Hi Neil,

On Monday, September 30, 2024 at 2:03:54 PM UTC+8 Neil Hodgson wrote:
 
On Linux, the Find in Files command works by running another SciTE process with the text provided as a command-line argument.
...
It would likely be better to reimplement using threads instead of processes as is done for Windows and MacOS.

I wonder if this change is planned in the future. Switching to the command line to execute the "SciTE -grep" command every time is tedious :(

Thanks,
Jingcheng

Neil Hodgson

unread,
Feb 10, 2025, 3:50:03 PMFeb 10
to scite-interest
Jingcheng Zhang:
 
I wonder if this change is planned in the future. Switching to the command line to execute the "SciTE -grep" command every time is tedious :(

   Using threads for find in files on Linux like the other platforms would be a good project for someone to develop.

   I don't have a list of features that I plan to do as facing a long feature backlog would be disheartening.

   Neil
Reply all
Reply to author
Forward
0 new messages