This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When doing Tools -> Open in Terminal (either by right-clicking the file or through the menu bar), a Terminal opens as expected, but it always opens the default /home/myusername directory, instead of something like /cygdrive/c/folder/containing/the/selected/file. This is with Cygwin64. Product Version: NetBeans IDE Dev (Build 201604130001) Java: 1.8.0_77; Java HotSpot(TM) 64-Bit Server VM 25.77-b03 Runtime: Java(TM) SE Runtime Environment 1.8.0_77-b03 System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Thanks for reporting an issue! I've experienced some problems with Cygwin paths. I'll try to reproduce your configuration early next week. Do you have non-latin characters, spaces int your path? Or it fails to open for any path?
It fails to open for any path. For example, I just created a new "Java Application" project, and did "Open in Terminal" on the generated Java class. The expected directory was: /cygdrive/c/Users/vanelvan/Documents/NetBeansProjects/JavaApplication7/src/javaapplication7 but Cygwin opened in the default directory. If I do a "cd" to this directory in the terminal, it correctly changes the directory, so I'd say it's not a problem with Cygwin.
Thanks! And after you cd manually, does terminal changes it's title? Usually it has title like "localhost - <your current cwd>" and updates every time you change directory to another one.
Yes, the tab changes its title every time. I don't know if it matters, but my title doesn't have the "localhost - " prefix. When I do "Open in Terminal", the title is just "~" When I do cd, the title is "<cwd>", possibly cut off if it's too long: "...end/of/very/long/path"
For some reason Terminal's NativeProcessBuilder on Windows starts in home dir and ignores the "setWorkingDirectory("someDir"). Still investigating.
This issue appears only under Cygwin. Reason: When we open run bash under our Terminal we use --login option. When --login is used bash reads /etc/profile among other init files. In Cygwin /etc/profile contains lines: # Make sure we start in home unless invoked by CHERE if [ ! -z "${CHERE_INVOKING}" ]; then unset CHERE_INVOKING else cd "${HOME}" || echo "WARNING: Failed attempt to cd into ${HOME}!" fi which resets our efforts to run bash in a correct directory.
Fixed in: https://hg.netbeans.org/cnd-main/rev/ba9f5321ae70