You are not logged in.
When I drag a file from the File Manager into a terminal window, it generates the full path and filename, which is what I would expect it to do.
However, it automatically wraps the whole path within single-quotes (') and adds two line breaks:
jimjamz@bunsen-dev-vm:~$ '/home/jimjamz/path/to/file.txt
>
> '
macOS terminal does not do this:
mac-pro:~ jimjamz$ /Users/jimjamz/path/to/file.txt
This causes havoc with my shell scripts which expect a file to be dropped into them, so I have to do something like this:
echo "Drop the file here: "
read droppedFile
# have to do this because when dragging in a file it into the terminal
# it appends a ' to the beginning of the outputted filename
echo "The file to be used is: "
actualFile=$(echo $droppedFile | sed 's/'"'"'//g')
echo $actualFile
Is this a bug?
Offline
what OS / file manager / terminal? Certainly not the case here with Stretch/thunar/terminator.
Offline
I get the behaviour with BL/thunar/terminator running in VBox. I will have to reboot to test it on bare metal....
EDIT: ....no problem with BL-Helium-dev/thunar/terminator.
@OP are you running in a VM? I guess so - "jimjamz@bunsen-dev-vm"
Last edited by damo (2017-03-10 17:20:31)
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Drag-and-drop in jessie from thunar to these terminals:
lxterminal - shows nothing at all
roxterm - full path, single quotes, plus trailing space, no newlines.
xfce4-terminal - full path, no quotes, no spaces, no newlines
xterm - shows nothing at all
Behaviour appears defined by the terminal emulator, sometimes not at all.
If you want a consistent drop target for files, you can create a desktop launcher. It is not difficult, but it is an additional step. Example (basic, not advanced values):
[Desktop Entry]
Version=1.0
Type=Application
Path=
Exec=/home/craig/bin/url-link %u
Icon=url-link
StartupNotify=false
Terminal=false
Name=URL
MimeType=application/x-mswinurl;application/x-desktop
Search for an (XDG) desktop launcher howto for details (or just experiment). My primary hint is to use "Exec=myscript %F" where %F (case sensitive) will be replaced with the file or group of files dropped on the launcher. Use %f for a single file. Similar action for URLs with %U and %u.
Offline
One more terminal:
urxvt - shows nothing at all
A simple workaround is copy/paste instead of drag/drop. In urxvt that gives me the filepath, with no wrapping quotes. Slightly more effort.
I can confirm that cpoakes' .desktop file solution works for passing files to scripts with d&d.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
for the script:
reading contents of selection (a.k.a. primary clipboard) could help.
so instead of drag'n'drop, the user would simply have to _highlight_ the file in question.
i think 'xclip -o' should be sufficient.
edit:
no, sorry, that wouldn't work with a graphical filemanager.
Last edited by ohnonot (2017-03-11 06:28:32)
Offline
Yes, I am running bl-hydrogen in a VirtualBox VM on a macOS host.
Everything on the BunsenLabs guest VM is vanilla standard. Original file manager and terminal window.
I do have the same version of bunsenlabs installed bare metal onto another laptop but I haven't been able to try it yet.
Really, this should just work out of the box as it's a rather trivial and widely-used bit of functionality, isn't it?
Offline
Yes, I am running bl-hydrogen in a VirtualBox VM on a macOS host.
...
Really, this should just work out of the box as it's a rather trivial and widely-used bit of functionality, isn't it?
I think you should blame Oracle Guest Additions, since it works OK in BL on bare metal.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Yes, I am running bl-hydrogen in a VirtualBox VM on a macOS host.
Confirmed with Jessie running as vm on OSX, no such problem with Stretch running as vm on OSX.
Offline
I think you should blame Oracle Guest Additions, since it works OK in BL on bare metal.
I'm afraid not, as I replicated the same issue last night on bl-hydrogen, installed bare metal onto an ASUS EEE PC. Dragging any file into a terminal window does the exact same thing.
Offline
As cpoakes has already pointed out, this is a function of the terminal emulator, not of BunsenLabs. Is there any Linux terminal emulator with the exact behaviour you want? If so, please feel free to suggest it as a replacement for Terminator in our next release. Meanwhile, install and use it.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline
Confirmed with Jessie running as vm on OSX, no such problem with Stretch running as vm on OSX.
When you refer to Jessie and Stretch, do you mean bunsenlabs based on these Debian versions? Does this mean that the issue I'm having in bl-hydrogen (Jessie) will no longer be an issue in bl-helium (Stretch)?
If so, is that because we're going to be using a different terminal emulator?
Offline
jimjaz: that's right. p.s. Not a different terminal emulator, but a newer version of terminator.
Offline
^ Terminator is still planned to be the default on Helium, although as always there are mutterings to change it. The issue doesn't happen with my BL-Helium-dev + terminator, so take from that what you want! I suspect that the problem is fixed in newer terminator versions.
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
there are mutterings to change it.
Any threads on the subject?
Offline
damo wrote:there are mutterings to change it.
Any threads on the subject?
Please, absolutely not! There is always pressure to change, but I doubt if there is any appetite to repeat the interminable(!) fight that was had when #! ended. Any terminal emulator is an apt-get away anyway.
If there is to be a change then IMO the devs should just do it unilaterally, because experience shows that there will never be a forum concensus!
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Sure
Offline
I almost hope someone starts a thread, so I can move it to Topics Going Nowhere ]:D
Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt «» BunsenLabs on DeviantArt
Offline
Postpone all your duties; if you die, you won't have to do them ..
Offline
Please, absolutely not! There is always pressure to change, but I doubt if there is any appetite to repeat the interminable(!) fight that was had when #! ended. Any terminal emulator is an apt-get away anyway.
My opinion exactly. I don't like terminator, remove terminator, and install something else. Yet I fully support defaulting to terminator for consistency. After that last round, I'd say we have a better chance reaching consensus on an official ice cream flavor for BunsenLabs than a terminal.
De gustabus non disputandum est.
Offline