Filebot bash autocomplete can't complete filenames/paths with spaces?

All your suggestions, requests and ideas for future development
Post Reply
infamous
Posts: 7
Joined: 07 Jan 2022, 03:33

Filebot bash autocomplete can't complete filenames/paths with spaces?

Post by infamous »

I'm using the latest filebot on an Ubuntu Server 20.04. When manually calling a filebot command, I can't seem to tab autocomplete a folder name with spaces in it. It will just autocomplete the first word of the folder name. Even if I manually keep typing the next word (escaping the spaces) it still does not autocomplete. I read a little bit of '/etc/bash_completion.d/filebot' to no avail and Googling led me nowhere. When I press [TAB][TAB] after the first word is completed, bash just lists random words included in the folder name. The same issue applies to path names with spaces too. With normal bash commands the same folder name is autocompleted as expected.

Code: Select all

# Local Time #
Thu Jan 06 22:37:31 EST 2022

# Process Tree #
/usr/bin/bash
└─ /usr/bin/dash
   └─ /usr/lib/jvm/java-11-openjdk-amd64/bin/java

# Environment Variables #
DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
LANG: en_US.UTF-8
LESSCLOSE: /usr/bin/lesspipe %s %s
LESSOPEN: | /usr/bin/lesspipe %s
LOGNAME: x
LS_COLORS:
MOTD_SHOWN: pam
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
PWD: /home/
SHELL: /bin/bash
SHLVL: 1
SSH_CLIENT: 192.168.50.99 33912 22
SSH_CONNECTION: 192.168.50.99 33912 192.168.50.196 22
SSH_TTY: /dev/pts/0
TERM: alacritty
USER: 
XDG_DATA_DIRS: /usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_RUNTIME_DIR: /run/user/1000
XDG_SESSION_CLASS: user
XDG_SESSION_ID: 48
XDG_SESSION_TYPE: tty
_: /usr/bin/filebot

# Java System Properties #
application.cache: /home/x/.filebot/cache
application.deployment: deb
application.dir: /home/x/.filebot
awt.toolkit: sun.awt.X11.XToolkit
awt.useSystemAAFontSettings: on
file.encoding: UTF-8
file.separator: /
grape.root: /home/x/.filebot/grape
groovy.antlr4: false
http.agent: FileBot/4.9.4
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
java.awt.printerjob: sun.print.PSPrinterJob
java.class.path: /usr/share/filebot/jar/filebot.jar
java.class.version: 55.0
java.home: /usr/lib/jvm/java-11-openjdk-amd64
java.io.tmpdir: /home/x/.filebot/tmp
java.library.path: /usr/lib/x86_64-linux-gnu/jni
java.net.useSystemProxies: true
java.runtime.name: OpenJDK Runtime Environment
java.runtime.version: 11.0.13+8-Ubuntu-0ubuntu1.20.04
java.specification.name: Java Platform API Specification
java.specification.vendor: Oracle Corporation
java.specification.version: 11
java.vendor: Ubuntu
java.vendor.url: https://ubuntu.com/
java.vendor.url.bug: https://bugs.launchpad.net/ubuntu/+source/openjdk-lts
java.version: 11.0.13
java.version.date: 2021-10-19
java.vm.compressedOopsMode: 32-bit
java.vm.info: mixed mode, sharing
java.vm.name: OpenJDK 64-Bit Server VM
java.vm.specification.name: Java Virtual Machine Specification
java.vm.specification.vendor: Oracle Corporation
java.vm.specification.version: 11
java.vm.vendor: Ubuntu
java.vm.version: 11.0.13+8-Ubuntu-0ubuntu1.20.04
jdk.debug: release
jdk.logger.packages: net.filebot.Log
jdk.module.path: /usr/share/openjfx/lib
jna.boot.library.name: jnidispatch.system
jna.boot.library.path: /usr/lib/x86_64-linux-gnu/jni
jna.library.path: /usr/lib/x86_64-linux-gnu/jni
jna.nosys: false
jna.nounpack: true
line.separator:

net.filebot.archive.extractor: ShellExecutables
net.filebot.gio.GVFS: /run/user/1000/gvfs
net.filebot.theme: Darcula
org.apache.commons.logging.Log: org.apache.commons.logging.impl.NoOpLog
os.arch: amd64
os.name: Linux
os.version: 5.4.0-92-generic
path.separator: :
prism.order: sw
sun.arch.data.model: 64
sun.boot.library.path: /usr/lib/jvm/java-11-openjdk-amd64/lib
sun.cpu.endian: little
sun.cpu.isalist:
sun.io.unicode.encoding: UnicodeLittle
sun.java.command: /usr/share/filebot/jar/filebot.jar -script fn:sysenv
sun.java.launcher: SUN_STANDARD
sun.jnu.encoding: UTF-8
sun.management.compiler: HotSpot 64-Bit Tiered Compilers
sun.net.client.defaultConnectTimeout: 10000
sun.net.client.defaultReadTimeout: 60000
sun.os.patch.level: unknown
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel
unixfs: false
useCreationDate: false
useExtendedFileAttributes: true
useGVFS: true
user.country: US
user.dir: /home/x
user.home: /home/x
user.language: en
user.name: x
user.timezone: America/Toronto

# Arguments #
args[0] = -script
args[1] = fn:sysenv
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot bash autocomplete can't complete filenames/paths with spaces?

Post by rednoah »

Sorry, that part is auto-generated, we probably won't be able to fix this ourselves, but if you're familiar with bash completion internals, then we'd welcome a patch. The issue is most likely somewhere here, perhaps just a matter of escaping or passing things differently:
https://github.com/filebot/plugins/blob ... lebot#L248


:idea: Alternatively, you can jus delete /etc/bash_completion.d/filebot. That will restore default bash completion behaviour, better for completing files, but won't be able to complete filebot-specific options.
:idea: Please read the FAQ and How to Request Help.
infamous
Posts: 7
Joined: 07 Jan 2022, 03:33

Re: Filebot bash autocomplete can't complete filenames/paths with spaces?

Post by infamous »

Thank you I appreciate the response. Oh ok, well it's good to know that I can always delete that file if I ever need to.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot bash autocomplete can't complete filenames/paths with spaces?

Post by rednoah »

Adding lots of local IFS=$'\n' seems to make it work better:
https://github.com/filebot/plugins/comm ... a66e171ba1
:idea: Please read the FAQ and How to Request Help.
Post Reply