The default kile version (Kile 2.9.91) shipped with kubuntu 18.04 does not behave as expected. In older versions this
$ kile myfile.tex
would open myfile.tex
for editing. However, in the current version this tries and fails to open http://myfile.tex
. The error message I get is "http://myfile.tex Host not found", which is not too surprising. I tried to wrap the filename in quotes, use kile ./myfile.tex
and kile file://myfile.tex
. The first did not change anything, the second and third resulted in a segfault.
What is the right way to open files using the command line in Kile 2.9.91?
What works, what doesn't?
$ kile myfile.tex -> Error: http://myfile.tex
$ kile "myfile.tex" -> Error: http://myfile.tex
$ kile myfile.txt -> Error: http://myfile.txt
$ kile myfile -> Error: http://myfile
$ kile Documents/myfile.tex -> Error: http://documents/myfile.tex
$ kile ~/Documents/myfile.tex -> Works!
$ kile /home/user/Documents/myfile.tex -> Works!
$ kile $(realpath myfile.tex) -> Works!
$ kile ./myfile.tex -> segfault
$ kile file://myfile.tex -> segfault
Dirty workaround time: write a function into your
.bashrc
/.zshrc
(others might work these two are the only ones I tested) that callsrealpath
to get the absolute path of the input file:To regain the intended behavior (for one file at a time, not working with any other parameters, this can easily be improved with some bash knowledge). This is by no means a solution, just a way to mimic the intended behavior for now.
Inspired by @m00am solution, in
bash
you can add the following to the.bashrc
:The command
kile myfile.tex
will then work. Personnally, I even redirect the output to/dev/null
and release the command: