If lxterminal is already running, and if one tries to launch another lxterminal from a directory that contains spaces for example, this new term doesn't get this current working directory, but ~ instead. This happens for example when F4 is pressed in pcmanfm.
This problem comes from the fact that when there is already an instance running, arguments for the new instance are given through a unix socket, and for the --working-directory option, no caracters are escaped, so that the first instance receives for example:
lxterminal --working-directory=/home/joe/my documents
This can be fixed by replacing, at the end of unixsocket.c,
gchar * working_directory_argument = g_strdup_printf(" --working-directory=%s", working_directory);
gchar * working_directory_argument = g_strdup_printf(" --working-directory=\'%s\'", working_directory);
but it's dirty since it doesn't work if the path contains a ' (quote) for example.
I'm not sure what escape function is to be used, because of charsets.
glib's g_strescape doesn't escape spaces.