1

In the Altera Quartus ii 15.0 software, Tools->Options->Preferred Text Editor tab, is used to change the editor when opening file. There's an option for vim, and the command line looks like this:

"<<browse to specify executable location>>" -c %l %f

where %l = line number and %f = filename. Substitute it with /usr/bin/vim, click a file under project, nothing shows up. gvim works fine but I do want to use the terminal version. Here are some inputs I tried:

"/usr/bin/konsole -e vim %f"

Clicking file prompts cannot find executable

"/usr/bin/konsole" -e vim %f

Clicking file nothing happens(shows up)

"/usr/bin/konsole" --nofork -e vim %f

Same as above

"/usr/bin/xterm" -e vim %f

This works but I prefer konsole

I also tried create a bash file(already +x) with content as following but in vain:

#!/usr/bin/bash
konsole --nofork -e vim "$1" > /dev/null 2>&1 # same behavior with/without --nofork and the redirection stuff

There's also a Custom option and I repeated the same procedures as above, failed.

Once I substitute konsole with xterm it works. So what's the difference between these two? And how can I call cli vim inside konsole in this software? I recall that when I use gnome-terminal creating a script to invoke vim works perfectly, but that's another software so things may be different.

Xiangyu Zhu
  • 171
  • 1
  • 2
  • 15
  • What happens if you type all these commands in a terminal instead of using Quartus to launch them? – Renaud Pacalet Sep 22 '15 at 05:45
  • Replacing `%f` with file name manually, all of the above commands successfully start a new terminal with vim started. – Xiangyu Zhu Sep 22 '15 at 06:19
  • Interesting. So, it seems that it is Quartus that does not like `konsole`. I may be wrong but I suspect a shared library problem. The CAD tools vendors tend to redefine the environment variables that point to shared libraries (e.g. `LD_LIBRARY_PATH`) in order to point to their own libraries. They do not know that this is bad and that it breaks most external software they call from their tools. Can you launch Quartus from the command line and look at the potential error messages? Or unset `LD_LIBRARY_PATH` in your bash script before launching `konsole`. – Renaud Pacalet Sep 22 '15 at 14:09
  • When I start it from the CLI it just says `Inconsistency detected by ld.so: dl-close.c: 811: _dl_close: Assertion \`map->l_init_called\' failed!` at startup but don't output anything when opening file. And `echo $LD_LIBRARY_PATH` outputs nothing too, before and during the execution of Quartus ii. – Xiangyu Zhu Sep 23 '15 at 02:10
  • And what about the other suggestion: unset LD_LIBRARY_PATH in your bash script before launching `konsole`? – Renaud Pacalet Sep 23 '15 at 05:07
  • `Konsole` starts without any problems. Since `LD_LIBRARY_PATH` is empty (all the time) maybe unsetting it makes no difference here. – Xiangyu Zhu Sep 23 '15 at 08:15
  • 1
    I think we do not understand each other. I was referring to your attempt to _create a bash file(already +x) with content as following but in vain_. Did you try to put `unset LD_LIBRARY_PATH` before the call to `konsole` **inside** this bash script and try to associate the execution of this script to the Quartus command? – Renaud Pacalet Sep 23 '15 at 08:52
  • Sorry for the late reply. This actually works! Thank you! – Xiangyu Zhu Sep 23 '15 at 13:40
  • OK, fine. I will write a true answer such that others can find it also. – Renaud Pacalet Sep 23 '15 at 14:38

1 Answers1

1

It may be a shared library problem. The CAD tools vendors tend to redefine the environment variables that point to shared libraries (e.g. LD_LIBRARY_PATH) in order to point to their own libraries. Unfortunately, doing so frequently breaks the external software called from their tools like, for instance, web browsers (to access the documentation) or editors (your case).

A solution that sometimes works is to wrap the call to the external software applications in a shell script that fixes this. In your case you can try to adapt your bash script:

#!/usr/bin/bash
unset LD_LIBRARY_PATH
konsole --nofork -e vim "$1" > /dev/null 2>&1

and call it from Quartus instead of calling konsole directly.

Renaud Pacalet
  • 25,260
  • 3
  • 34
  • 51