Search code examples
linuxbashvimquartuskonsole

how to invoke terminal vim under Quartus ii?


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.


Solution

  • 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.