Multi-line text in staticHistory
b0x4it opened this issue · comments
b0x4it commented
Is it possible to have multi-line text in staticHistory?
Erèbe - Romain Gerard commented
Hello,
With a bit of trickery yes
printf 'a\xA0b\xA0c' > static_history
iconv -f latin1 -t utf-8 static_history > static_history.tmp
iconv -f latin1 -t utf-8 static_history.tmp > static_history
mv static_history ~/.cache/greenclip.staticHistory
\xA0
is a void character used internally by greenclip to replace \n
. We inject it with printf instead of \n
and convert the file until it is a valid utf-8 file.
After that the \xA0 will be present as a valid utf-8 and will be replaced by \n by greenclip
You will see a b c
when you print the history but it will be with line separator with selected/pasted.
Not very user friendly but it works...
b0x4it commented
Great, thank you!
Erèbe - Romain Gerard commented
done in version 4.0
static history is now in the config file
static_history = [
'''¯\_(ツ)_/¯''',
]