rickyrockrat / parcellite

GNU General Public License v3.0
220 stars 29 forks source link

xdotool Segfault with apostrophes #87

Open targzeta opened 10 months ago

targzeta commented 10 months ago

Hi,

Config file

[rc]
RCVersion=1
use_copy=true
use_primary=true
synchronize=false
save_history=false
history_pos=false
history_x=1
history_y=1
history_limit=25
data_size=0
item_size=5
automatic_paste=true
auto_key=false
auto_mouse=true
key_input=true
restore_empty=false
rc_edit=false
type_search=true
case_search=true
ignore_whiteonly=false
trim_wspace_begend=true
trim_newline=false
hyperlinks_only=false
confirm_clear=false
disable_clear=false
save_history_Lineno=true
current_on_top=true
single_line=true
reverse_history=false
item_length=50
persistent_history=false
persistent_separate=false
persistent_on_top=false
persistent_delim=\\n
nonprint_disp=false
ellipsize=2
multi_user=false
on_unity=false
icon_name=parcellite
menu_key=<Ctrl><Alt>P
history_key=<Ctrl><Alt>H
phistory_key=<Ctrl><Alt>X
actions_key=<Ctrl><Alt>A

Version

$> parcellite --version
Flag 0x0001, status 0, EXIT 1 STAT 0
Parcellite 20230829, GTK 2.24.33

The string I would like to paste (selected with primary selection) The Chris's dog

First paste (with Ctrl+Alt+H)

(parcellite:20401): GLib-CRITICAL **: 23:25:45.846: g_spawn_async_with_pipes_and_fds: assertion 'argv != NULL' failed

(parcellite:20401): GLib-CRITICAL **: 23:25:45.846: g_child_watch_add_full: assertion 'pid > 0' failed

Second paste Segmentation Fault

I don't know if it's my system or it's a real bug. Can you reproduce these steps?

Best regards, Emanuele

rickyrockrat commented 7 months ago

I can't. Can you give me more details? I copied 'The Chris's dog', and it appears in the clipboard. I can then select and paste anywhere. What system are you on?

rickyrockrat commented 6 months ago

I know what the problem is, and I have to ask myself if this is a parcellite issue. I can escape single quotes, and maybe I should, but without them, this will kill xdotool. I've updated the issue to reflect what's really happening.

targzeta commented 6 months ago

Thank you!

Emanuele

rickyrockrat commented 6 months ago

If you can build the latest commit, I may have fixed the problem. These multiple levels of escaping things is not fun. :) It looks like I killed shell interpretation of variables, but xdotool works. So I solved one bug and created another. Lovely.

targzeta commented 6 months ago

Mmm, I can confirm that it doesn't exit, but the single quote char now is quoted when I paste the content: "A Chris\'s dog"

What do you think about? Emanuele

rickyrockrat commented 6 months ago

It is a work in progress. That is the first attempt to make sure the problem goes away. I'm still crafting a solution.

targzeta commented 5 months ago

Hi, I think that is it related to the same problem. When I select a string that start with a dash, parcellite doesn't print nothing. If I run parcellite in foreground mode I have:

Usage: type [--window windowid] [--delay milliseconds] <things to type>
--window <windowid>    - specify a window to send keys to
--delay <milliseconds> - delay between keystrokes
...

I suppose we should run xdotool type -- line, do you agree?

Emanuele