You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "jtulach (via GitHub)" <gi...@apache.org> on 2025/08/23 09:09:39 UTC
[PR] Open file from embedded terminal, easily! [netbeans]
jtulach opened a new pull request, #8756:
URL: https://github.com/apache/netbeans/pull/8756
- since I am working with VSCode I admire its integration with its embedded shell
- I'd like NetBeans terminal integration to be as good
- one thing I like a lot is ability to open a file from the terminal
<img width="852" height="471" alt="image" src="https://github.com/user-attachments/assets/b206f541-6bda-4606-b542-df42560aadb3" />
- e.g. typing `netbeans pom.xml` in the embedded terminal would open the file in the IDE the terminal is embedded into
- I had such a setup locally for years, but:
- it doesn't work with other than default `--userdir` well
- not everyone is capable to set it up
- thus I want to provide such a support for everyone
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2311892066
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
Setting an environment variable for the basedir and/or the executable file path isn't unusual. If using it directly feels unusual, then a separate script could be used to do this.
The problem is anything that already puts `netbeans` on the `PATH`. If you are running an alternative (zip) version with an appended `PATH` then you'll get the default install. That may still do the right thing in most cases, once they have a version of NetBeans with the launcher that understands `NETBEANS_USERDIR` included. I've no idea if other Linux packages play around with `userdir`, although they also not put `netbeans` on the `PATH`, but the `DEB` and `RPM` don't do anything.
If the `netbeans` location is prepended, then using the installed RPM or DEB packages this would cause calls to `netbeans` to go directly to `/usr/lib/apache-netbeans/bin/netbeans` rather than via `/usr/bin/netbeans` which would in some cases fail due to missing extra configuration.
In all, I have reservations about modifying the `PATH`, but appending would be less likely to break things while not working in all scenarios. Environment variables feel a little more reliable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3417794367
> preferably merged early in the next dev cycle
That's right now!
### Final steps in this PR:
- [ ] Keep [architecture simple & allow opt out](https://github.com/apache/netbeans/pull/8756#issuecomment-3289163979)
- [ ] Investigate [harness launcher](https://github.com/apache/netbeans/pull/8756#issuecomment-3388564175)
- [ ] squash commits into one
- [ ] merge into master branch
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2311837776
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
If find the environment variable `$NB` approach unnatural. I never used something like that before.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-4061312448
> NETBEANS_USERDIR=IGNORE doesn't seem to work since it will cause NB instances started from the terminal to use IGNORE as user dir.
- Thanks for the report
- it is addressed in #9273
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2347152969
##########
nb/ide.launcher/windows/nblauncher.cpp:
##########
@@ -114,6 +128,18 @@ int NbLauncher::start(int argc, char *argv[]) {
if (!userDir.empty()) {
newArgs.add(ARG_NAME_USER_DIR);
newArgs.add(userDir.c_str());
+ if (!skipUserDir) {
+ string toSet = ENV_NETBEANS_USERDIR;
+ toSet = toSet + "=" + userDir;
+ putenv(toSet.c_str());
+
+ const char* path = getenv("PATH");
+ if (path != NULL) {
+ string setPath = "PATH=";
+ setPath = setPath + path + ";" + baseDir + "\\bin\\";
+ putenv(setPath.c_str());
Review Comment:
I tested these changes with following program:
```java
package execenv;
public class ExecEnv {
public static void main(String[] args) throws Exception {
System.out.println("Env: " + System.getenv("PATH"));
var p = new ProcessBuilder("netbeans", "S:\\readme.txt").start();
var r = p.waitFor();
System.out.println("Res: " + r);
}
}
```
when executed on NetBeans 27 it fails with:
```
run:
Env: C:\Program Files\OpenSSH\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\jst\.cargo\bin;C:\Users\jst\AppData\Local\Microsoft\WindowsApps;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files\Git\bin;S:\windows\bin;S:\windows\bin\graalvm-community-openjdk-24.0.1+9.1\bin\;S:\windows\bin\sbt-1.7.2\bin\;
Exception in thread "main" java.io.IOException: Cannot run program "netbeans": CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1044)
at execenv.ExecEnv.main(ExecEnv.java:6)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:485)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:146)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1076)
... 2 more
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 1 second)
```
With changes in this PR it **properly opens the file** in the IDE executing the script. Setting ` NETBEANS_USERDIR=nope` opts-out and falls back to previous behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2347152969
##########
nb/ide.launcher/windows/nblauncher.cpp:
##########
@@ -114,6 +128,18 @@ int NbLauncher::start(int argc, char *argv[]) {
if (!userDir.empty()) {
newArgs.add(ARG_NAME_USER_DIR);
newArgs.add(userDir.c_str());
+ if (!skipUserDir) {
+ string toSet = ENV_NETBEANS_USERDIR;
+ toSet = toSet + "=" + userDir;
+ putenv(toSet.c_str());
+
+ const char* path = getenv("PATH");
+ if (path != NULL) {
+ string setPath = "PATH=";
+ setPath = setPath + path + ";" + baseDir + "\\bin\\";
+ putenv(setPath.c_str());
Review Comment:
I tested these changes with following program:
```java
package execenv;
public class ExecEnv {
public static void main(String[] args) throws Exception {
System.out.println("Env: " + System.getenv("PATH"));
var p = new ProcessBuilder("netbeans", "S:\\readme.txt").start();
var r = p.waitFor();
System.out.println("Res: " + r);
}
}
```
when executed on NetBeans 27 it fails with:
```
run:
Env: C:\Program Files\OpenSSH\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\jst\.cargo\bin;C:\Users\jst\AppData\Local\Microsoft\WindowsApps;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files\Git\bin;S:\windows\bin;S:\windows\bin\graalvm-community-openjdk-24.0.1+9.1\bin\;S:\windows\bin\sbt-1.7.2\bin\;
Exception in thread "main" java.io.IOException: Cannot run program "netbeans": CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1044)
at execenv.ExecEnv.main(ExecEnv.java:6)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:485)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:146)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1076)
... 2 more
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 1 second)
```
With changes in this PR it properly opens the file in the IDE executing the script.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3448939127
> I think this should be reverted as that variant already exists and we don't need two implementations of the same feature.
I'm inclined to agree _if_ the existing implementation there can be branded and enhanced to meet the other concerns.
More importantly, if a PMC member is making the above comment, this should at least be reviewed and resolved before further progress is made.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295969137
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -66,7 +69,11 @@ fi
export DEFAULT_USERDIR_ROOT
# #68373: look for userdir, but do not modify "$@"
-userdir="${netbeans_default_userdir}"
+if [ -z "$NETBEANS_USERDIR" ]; then
Review Comment:
Sorry. I wanted to talk about `--userdir` CLI argument. Fixed by modifying the comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2416747195
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,12 +38,18 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
-case "`uname`" in
+case "`uname -s -m`" in
Darwin*)
# set default userdir and cachedir on Mac OS X
DEFAULT_USERDIR_ROOT="${HOME}/Library/Application Support/NetBeans"
DEFAULT_CACHEDIR_ROOT=${HOME}/Library/Caches/NetBeans
;;
+ CYGWIN*_64)
+ exec $progdir/netbeans64.exe $*
Review Comment:
Doesn't this need quoting? And ideally indenting.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3388564175
> Personally, I don't see a reason to rush this to get it into NB28, which with the Windows launcher changes will be a hard push to do before freeze. It would be better to get this in early for NB29 for proper testing.
- The [original plan](https://github.com/apache/netbeans/pull/8756#pullrequestreview-3147428765) aimed _"to get this change into NetBeans 28"_. But plan is a living document. Let's wait for NB29.
> The Windows changes here probably affect platform applications,
- Oh, no:
- https://github.com/apache/netbeans/blob/2e80f299fe42abbaa405cc370572b4e1175988ce/harness/apisupport.harness/windows-launcher-src/applauncher.h#L30
- who's architected such a crappy design?
- in my architect's view, applauncher should only depend on nbexec, but not the IDE's launcher!
- the fact that it is not the case, deserves some code changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3414528134
Wasn't able to catch up with this PR until now. I might have overlooked something while reading through the comments, but was the alias idea considered or dropped at some point?
Plain old java could initialize the terminal with an alias command (e.g `nb`) which sets whatever flags are needed, e.g userhome, jdkhome etc. No messing with the user's path, no need to change the launchers and the opt-out would become less important too since the risks/side effects of an alias are much lower. (the exe postfix on cygwin would also become a non-issue)
As Neil already mentioned, this could develop into a separate little feature in future since NB could open the terminal init script up to users (analog to `~/.bashrc` etc).
I actually got reminded of this PR today while testing RC1 using aliases. This allows me to detach the config, caches and test projects from the zip - even the launcher itself in a portable way funny enough ([link](https://github.com/mbien/nb-launcher)).
IMHO: The launchers are beyond hope by now, i wouldn't touch them unless something breaks again. The motivation getting fixes in is already fairly low according to the comment history of PRs like https://github.com/apache/netbeans/pull/7908 ;)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "priyanahata (via GitHub)" <gi...@apache.org>.
priyanahata commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3946863972
apache deleted a comment
if apache can delete a comment... apache should be able to do some coding....
right?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295517191
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -66,7 +69,11 @@ fi
export DEFAULT_USERDIR_ROOT
# #68373: look for userdir, but do not modify "$@"
-userdir="${netbeans_default_userdir}"
+if [ -z "$NETBEANS_USERDIR" ]; then
Review Comment:
- use environment value, if defined as `--jdkhome` default
- if one specifies `--jdkhome` CLI argument explicitly it takes precedence
- otherwise the userdir (if specified) is inherited from parent process
- that way just typing `netbeans` in integrated terminal talks to itself via `CLIHandler`' using the same user dir
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295516145
##########
ide/dlight.terminal/src/org/netbeans/modules/dlight/terminal/action/TerminalSupportImpl.java:
##########
@@ -267,14 +268,14 @@ private void doWork() {
term.setEmulation("xterm"); // NOI18N
NativeProcessBuilder npb = NativeProcessBuilder.newProcessBuilder(env);
+ final MacroMap envVars = npb.getEnvironment();
// clear env modified by NB. Let it be initialized by started shell process
- npb.getEnvironment().put("LD_LIBRARY_PATH", "");// NOI18N
- npb.getEnvironment().put("DYLD_LIBRARY_PATH", "");// NOI18N
-
+ envVars.put("LD_LIBRARY_PATH", "");// NOI18N
+ envVars.put("DYLD_LIBRARY_PATH", "");// NOI18N
Review Comment:
- it was always clear to me I need to set an _environment variable_ to represent the value of `--userdir`
- otherwise the `CLIHandler` won't be able to connect to the same NetBeans process
- originally I thought I will have to make changes here, but ...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2296002276
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -66,7 +69,11 @@ fi
export DEFAULT_USERDIR_ROOT
# #68373: look for userdir, but do not modify "$@"
-userdir="${netbeans_default_userdir}"
+if [ -z "$NETBEANS_USERDIR" ]; then
Review Comment:
> take `jdkhome` into account, which might be better handled by ensuring `JAVA_HOME` is set inside the launcher.
- I left a comment at https://github.com/apache/netbeans/pull/8725/files#r2295966792
- great to hear about #8725
- I leave `JAVA_HOME` outside of the scope of this PR and
- I let the #8725 deal with the `JAVA_HOME` handling on is own
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2347152969
##########
nb/ide.launcher/windows/nblauncher.cpp:
##########
@@ -114,6 +128,18 @@ int NbLauncher::start(int argc, char *argv[]) {
if (!userDir.empty()) {
newArgs.add(ARG_NAME_USER_DIR);
newArgs.add(userDir.c_str());
+ if (!skipUserDir) {
+ string toSet = ENV_NETBEANS_USERDIR;
+ toSet = toSet + "=" + userDir;
+ putenv(toSet.c_str());
+
+ const char* path = getenv("PATH");
+ if (path != NULL) {
+ string setPath = "PATH=";
+ setPath = setPath + path + ";" + baseDir + "\\bin\\";
+ putenv(setPath.c_str());
Review Comment:
I tested these changes with following program:
```java
package execenv;
public class ExecEnv {
public static void main(String[] args) throws Exception {
System.out.println("Env: " + System.getenv("PATH"));
var p = new ProcessBuilder("netbeans", "S:\\readme.txt").start();
var r = p.waitFor();
System.out.println("Res: " + r);
}
}
```
when executed on NetBeans 27 it fails with:
```
run:
Env: C:\Program Files\OpenSSH\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\jst\.cargo\bin;C:\Users\jst\AppData\Local\Microsoft\WindowsApps;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files\Git\bin;S:\windows\bin;S:\windows\bin\graalvm-community-openjdk-24.0.1+9.1\bin\;S:\windows\bin\sbt-1.7.2\bin\;
Exception in thread "main" java.io.IOException: Cannot run program "netbeans": CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1044)
at execenv.ExecEnv.main(ExecEnv.java:6)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:485)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:146)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1076)
... 2 more
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 1 second)
```
With changes in this PR it **properly opens the file** in the IDE executing the script.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3419318072
Things seem to be green. Let's integrate and then:
### Post Merge TODOs
- [ ] Wait for `netbeans*.exe` binaries to be produced somewhere
- [ ] Start a vote about such binaries like [in this case](https://lists.apache.org/thread/491tvp6o44nj9wpmcpbdtcmt8rn0d9h8)
- [ ] Create a PR to use those to be used by default
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2416175123
##########
nb/o.n.upgrader/arch.xml:
##########
@@ -621,6 +621,43 @@
clusters' fully qualified paths separated by path.separator (semicolon on Windows, colon on Unices)
</api></li>
</ul>
+ <p>
+ When the <code>netbeans</code> launcher starts, it also manipulates
+ (reads and writes) following properties:
+ </p>
+ <ul>
+ <li><api name="NETBEANS_USERDIR" category="devel" group="property" type="export">
+ <p>
+ If this <em>environment variable</em> is set to a valid value,
+ then its value is used as default user dir
+ instead of <code>netbeans_default_userdir</code> read from
+ the config file.
+ </p>
+ <p>
+ When the value of user dir is finally determined by the launcher
+ (by considering default values, value of this environment variable
+ and <code>--userdir</code> CLI switch, etc.) the launcher sets
+ <code>NETBEANS_USERDIR</code> environment variable for itself
+ and its subprocesses.
+ </p>
+ <p>
+ That way executing <code>netbeans</code> in the NetBeans internal
+ terminal will know what's the userdir of the surrouding NetBeans
+ and will open files in the same instance just as
+ <a href="https://github.com/apache/netbeans/pull/8756">#8756 illustrates</a>.
+ </p>
+ <p>
+ The launcher also modifies the <code>PATH</code> variable
Review Comment:
It is still part of the same `NETBEANS_USERDIR` API, so probably one `<li>` is correct. I changed the indentation in 1e13163 however.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2296076881
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
It might also be good to export the `BASEDIR` value added in #8408 , although possibly under a NetBeans specific name? That would in most cases be enough to find the launcher, but separate environment variables for current basedir and current launcher locations would be good. That should cover what you need without altering the path for everything else too?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3417928805
> GraalVM compiled launcher might be the right future.
the gh project I linked is just a toy to simplify cross platform testing for me it wasn't even originally meant to be used for NB, I rewrote it and put it into a repo. I run it as script.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3385948111
Personally, I don't see a reason to rush this to get it into NB28, which with the Windows launcher changes will be a hard push to do before freeze. It would be better to get this in early for NB29 for proper testing.
The Windows changes here probably affect platform applications, but the Unix changes don't. That should probably be looked at to ensure aligned behaviour.
The workflows shouldn't be showing waiting for approval - there's something awry with your account or the commit info here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3449787935
> if a PMC member is making the above comment, this should ... be reviewed
- Sure!
- So far there was _no process violation_
- Reasons to [integrate (parts of) this PR still exist](https://github.com/apache/netbeans/pull/8756#issuecomment-3448012229)
- Alas, because of change to Windows launchers, the integration must be done in _three steps_
- Right now we are in a _limbo_ - Unixes work as expected, Windows not yet
- #8959 is ready and works as expected
- please let me finish this PR by proceeding with remaining _two steps_
- @matthiasblaesing please _confirm I can proceed_ and call a vote about the binaries
- Let's get this `NETBEANS_USERDIR` change done. The sooner it is fully in, the sooner we can test it!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3384998915
> The usability on windows is IMHO not good. I you run `netbeans` under windows you get an error, because the script launcher is invoked as it is a 100% match:
> You need to know, that you have to invoke the exe launcher, which
- I do not have cygwin installed, so I didn't run into the problem myself
- This problem is general - e.g. `bin/netbeans` doesn't work in Cygwin
- it's just exposed by my modification of PATH
- the best fix is to detect Cygwin and `exec $basedir/netbeans.exe $*`, isn't it?
> (for me surprisingly works even though I have a 64bit JDK)
- if I remember correctly there was some work on detecting 32/64 bit OS and invoking the right version
- maybe it is this change: https://github.com/emilianbold/netbeans-releases/commit/b3868434c0b42b8cc258e404578f7ffe650f8650#diff-8e5bfb87c8f91779308ed39f01e2484c0eb2bfbb1a1bdcf34eeef36130717c62R196
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2429973552
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,12 +38,18 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
-case "`uname`" in
+case "`uname -s -m`" in
Darwin*)
# set default userdir and cachedir on Mac OS X
DEFAULT_USERDIR_ROOT="${HOME}/Library/Application Support/NetBeans"
DEFAULT_CACHEDIR_ROOT=${HOME}/Library/Caches/NetBeans
;;
+ CYGWIN*_64)
+ exec "$progdir/netbeans64.exe" $*
+ ;;
+ CYGWIN*)
+ exec "$progdir/netbeans.exe" $*
+ ;;
Review Comment:
Thanks for the update. The idea to bridge to the exe file from the shell launcher is nice. The quoting of the binary path works, but the parameter is still problematic:
<img width="624" height="423" alt="grafik" src="https://github.com/user-attachments/assets/8af15c53-fa50-40f0-aba6-3e904dc3ba4c" />
Looking at the remainder of the file, a different parameter format works fine for me:
```suggestion
CYGWIN*_64)
exec "$progdir/netbeans64.exe" "$@"
;;
CYGWIN*)
exec "$progdir/netbeans.exe" "$@"
;;
```
<img width="459" height="151" alt="Image" src="https://github.com/user-attachments/assets/aea8a1af-13e1-461e-83fd-82a6073dbbab" />
The result (here tested with two files, one with space in path, one just to test two parameters):
<img width="688" height="541" alt="Image" src="https://github.com/user-attachments/assets/f5ac272d-b3e0-4503-8426-750fb2aeb54b" />
Both files are opened fine.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3673459646
- I am using the latest builds with [my changes](https://github.com/apache/netbeans/pull/8998#issuecomment-3673458407) daily
- It seems to me there are no problems related to
- #8998
- #8959
- #8756
- I can use the embedded terminal on Linux, Windows (Cygwin), Mac and talk to the surrounding `netbeans` from it
- Btw. I started to pass `--userdir` when launching NetBeans more, as now the shell talks to the right instances automatically
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2311846041
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
Sure, it's unusual, but we need some way that a wrapper script can override this, and that is not path order dependent. Setting the PATH feels a little unsafe and unnecessary, and is going to break in interesting ways away from the zip bundle. The move to prepend rather than append fixes one problem but would introduce another, by bypassing the wrapper script for a system install.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3240504989
I am somewhat mixed on this. On one hand I think that if a terminal behaves differently in the IDE it is essentially a bug (that is also why I think that the launcher should probably not export `GDK_SCALE` on linux). On the other hand I can see that `netbeans` could be seen as special kind of program and the utility for it for users who run NB from the zip (I am one of them, but I do have `nb` already as **alias** without adding anything to the path, see 4th paragraph).
I am a bit worried about the can of worms this opens (why is javac, mvn, ant etc not in path too etc) and that it is set by default without opt-in or out.
Maybe the solution is to store it in an env var and add a text field to the terminal settings where users can configure path extensions in the sense of `PATH:NB_LAUNCHER_PATH`. (might have to be hidden on non-unix based systems since cygwin+windows might produce interesting results here and it could have `NB_DEFAULT_JDK` etc too in future)
I am wondering if `PATH` is even the right vehicle for this. Letting the NB terminal run `alias nb=NB_LAUNCHER_PATH` on start might have the smallest risk for side effects and cover the intended usecase.
> EDIT : I'm currently -1 to the PATH modification with prepend (..)
I agree, prepend would break existing user setups too, so if at all, it would have to be append IMO.
(slightly related to this proposal would be: path selection -> right click -> open in NB or System for output and terminal as quality of life improvement)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295704056
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
Could also consider an environment variable for the current NetBeans process here? eg. typing `$NB pom.xml` rather than `netbeans pom.xml`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3436597096
@jtulach please hold of on the rebuild of the launcher!
I was looking through the terminal code and I just noticed, that this PR is not required. NB already has the targeted feature. The implementation is here:
org.netbeans.modules.dlight.terminal.action.OpenInEditorActionProvider
You can run "ideopen" in the terminal and it will be caught by the netbeans infrastructure and turned into an open call. Quick test on Linux worked beautifully:
<img width="676" height="120" alt="grafik" src="https://github.com/user-attachments/assets/9ed309d3-2d98-44d3-8db5-30b44ef99e48" />
This is also faster than the launcher variant, as it does not need to launch a second instance. The running instance catches that itself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "JaroslavTulach (via GitHub)" <gi...@apache.org>.
JaroslavTulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3941473505
> doesn't seem to work
I am not sure I understand how it doesn't work? What's is the use-case and what are the steps to reproduce?
> since it will cause NB instances started from the terminal to use `IGNORE` as user dir.
I am trying to envision the use-case and I can imagine "something", but I am not sure I envision that properly. Better for you to spell it out with steps I can follow and evaluate.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "priyanahata (via GitHub)" <gi...@apache.org>.
priyanahata commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3946871283
can someone explain to me what type of headtrip you guys are on?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "priyanahata (via GitHub)" <gi...@apache.org>.
priyanahata commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3946845748
an no to no black magic
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3367928727
> the Windows launcher code is back in the main repository. It is built by the workflow at https://github.com/apache/netbeans/blob/master/.github/workflows/native-binary-build-launcher.yml When ready, the version numbers will need updating, binaries built from the workflow, and a release vote done - see #8408 and https://lists.apache.org/thread/491tvp6o44nj9wpmcpbdtcmt8rn0d9h8
- the changes were introduced by #8408
- then there was a subsequent PR integrating the voted launchers: #8361
- we do have the [binaries built as well](https://github.com/apache/netbeans/actions/runs/17714051833) but (of course) not yet from the merge commit
> When ready, the version numbers will need updating
- my understanding that the _only remaining change_ in this PR is to **update version numbers**
- just like [netbeans.exe.manifest](https://github.com/apache/netbeans/pull/8408/files#diff-b7da6cea606fe055b7d046391daab8b68d116b62e038014af8f1c5648f0eb031)
- just like [netbeans64.exe.manifest](https://github.com/apache/netbeans/pull/8408/files#diff-d9daf6af56e9d7de1f4dc8b91935591c36f2c05396fae8e983ed17e24b341a98)
- just like [version.h](https://github.com/apache/netbeans/pull/8408/files#diff-2205804fe510da31005746cadd38b61a0d082b99cdace8b94360464c5b602149)
- then we integrate this PR and once we have a _merge commit_
- I start a vote about the launcher binaries
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "priyanahata (via GitHub)" <gi...@apache.org>.
priyanahata commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3946844594
I will take that as a no
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3940646783
fwiw: `NETBEANS_USERDIR=IGNORE` doesn't seem to work since it will cause NB instances started from the terminal to use `IGNORE` as user dir. But I can workaround this by using a different launcher.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3448012229
Interesting. I still believe `netbeans` should mean `netbeans` in the terminal.
- the `ideopen` is totally unexpected, undicoverable functionality
- being able to call `./netbeans` gives access to all CLI options, not just open
I plan to finish the integration of this PR and subsequent actions as decided before the merge was approved.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2441566890
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,12 +38,18 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
-case "`uname`" in
+case "`uname -s -m`" in
Darwin*)
# set default userdir and cachedir on Mac OS X
DEFAULT_USERDIR_ROOT="${HOME}/Library/Application Support/NetBeans"
DEFAULT_CACHEDIR_ROOT=${HOME}/Library/Caches/NetBeans
;;
+ CYGWIN*_64)
+ exec "$progdir/netbeans64.exe" $*
+ ;;
+ CYGWIN*)
+ exec "$progdir/netbeans.exe" $*
+ ;;
Review Comment:
Thanks for the _space in path_ fix, Matthias.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295516663
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -138,6 +145,8 @@ launchNbexec() {
then
sh=/bin/bash
fi
+ NETBEANS_USERDIR=${userdir}
Review Comment:
- Store the value of `--userdir` to a system variable
- so that child processes can pick it up
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2296010288
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
> > typing $NB pom.xml
>
> Typing `netbeans` feels long, right? I also have a `nb` symlink and I will update it to point to the right `netbeans` executable or change it to `alias nb=netbeans`.
Actually, no, the length wasn't the reason. Putting the executable location in an environment variable rather than messing with the path at all keeps this more self contained and potentially safer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3239155010
> * modify `netbeans.exe` to behave the same
- do I understand correctly I need to make the change in the https://github.com/apache/netbeans-native-launchers/pull/12 repository?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2311885704
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
I don't want to do _"unusual things"_ in this PR, thus:
- either I revert back to append - it works for me and causes no surprises
- or I don't modify PATH at all - hoping `netbeans` is already on PATH
> The move to prepend rather than append fixes one problem
- this "[problem](https://github.com/apache/netbeans/pull/8756#discussion_r2295581421)"?
- it is not a problem as far as I can tell
- something gets invoked, something happens
- once the DEB or RPM launcher honors here in introduced `NETBEANS_USERDIR` environment variable...
- then the behavior will even be exactly as expected
- thus I'd say appending is the best way to modify `PATH` (should this PR modify `PATH` at all)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295516534
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
- append directory where `netbeans` launcher is located to the PATH
- for all processes launched from the IDE
- that way one can type `netbeans` in the terminal integration
- and be sure it is defined
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295993355
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
> Why append and not prepend?
I wanted to _play it safe_, but you are right. Inside of NetBeans terminal, it is safer to have the same `netbeans` executable invoked by default. Fixed in 914565a5be
> typing $NB pom.xml
Typing `netbeans` feels long, right? I also have a `nb` symlink and I will update it to point to the right `netbeans` executable or change it to `alias nb=netbeans`.
I leave this "shortcutting" out of scope of this PR. The important change is the support for _"inheriting user dir"_. Everything else is easy to script.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach merged PR #8756:
URL: https://github.com/apache/netbeans/pull/8756
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2347152969
##########
nb/ide.launcher/windows/nblauncher.cpp:
##########
@@ -114,6 +128,18 @@ int NbLauncher::start(int argc, char *argv[]) {
if (!userDir.empty()) {
newArgs.add(ARG_NAME_USER_DIR);
newArgs.add(userDir.c_str());
+ if (!skipUserDir) {
+ string toSet = ENV_NETBEANS_USERDIR;
+ toSet = toSet + "=" + userDir;
+ putenv(toSet.c_str());
+
+ const char* path = getenv("PATH");
+ if (path != NULL) {
+ string setPath = "PATH=";
+ setPath = setPath + path + ";" + baseDir + "\\bin\\";
+ putenv(setPath.c_str());
Review Comment:
I tested these changes with following program:
```java
package execenv;
public class ExecEnv {
public static void main(String[] args) throws Exception {
System.out.println("Env: " + System.getenv("PATH"));
var p = new ProcessBuilder("netbeans", "S:\\readme.txt").start();
var r = p.waitFor();
System.out.println("Res: " + r);
}
}
```
when executed on NetBeans 27 it fails with:
```
run:
Env: C:\Program Files\OpenSSH\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\jst\.cargo\bin;C:\Users\jst\AppData\Local\Microsoft\WindowsApps;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files\Git\bin;S:\windows\bin;S:\windows\bin\graalvm-community-openjdk-24.0.1+9.1\bin\;S:\windows\bin\sbt-1.7.2\bin\;
Exception in thread "main" java.io.IOException: Cannot run program "netbeans": CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1044)
at execenv.ExecEnv.main(ExecEnv.java:6)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:485)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:146)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1076)
... 2 more
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 1 second)
```
With changes in this PR it **properly opens the file** in the IDE executing the script. Setting ` NETBEANS_USERDIR=IGNORE` opts-out and falls back to previous behavior.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2416175123
##########
nb/o.n.upgrader/arch.xml:
##########
@@ -621,6 +621,43 @@
clusters' fully qualified paths separated by path.separator (semicolon on Windows, colon on Unices)
</api></li>
</ul>
+ <p>
+ When the <code>netbeans</code> launcher starts, it also manipulates
+ (reads and writes) following properties:
+ </p>
+ <ul>
+ <li><api name="NETBEANS_USERDIR" category="devel" group="property" type="export">
+ <p>
+ If this <em>environment variable</em> is set to a valid value,
+ then its value is used as default user dir
+ instead of <code>netbeans_default_userdir</code> read from
+ the config file.
+ </p>
+ <p>
+ When the value of user dir is finally determined by the launcher
+ (by considering default values, value of this environment variable
+ and <code>--userdir</code> CLI switch, etc.) the launcher sets
+ <code>NETBEANS_USERDIR</code> environment variable for itself
+ and its subprocesses.
+ </p>
+ <p>
+ That way executing <code>netbeans</code> in the NetBeans internal
+ terminal will know what's the userdir of the surrouding NetBeans
+ and will open files in the same instance just as
+ <a href="https://github.com/apache/netbeans/pull/8756">#8756 illustrates</a>.
+ </p>
+ <p>
+ The launcher also modifies the <code>PATH</code> variable
Review Comment:
It is still part of the same `NETBEANS_USER_DIR` API, so probably one `<li>` is correct. I changed the indentation in 1e13163 however.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3239160046
No, the Windows launcher code is back in the main repository. It is built by the workflow at https://github.com/apache/netbeans/blob/master/.github/workflows/native-binary-build-launcher.yml When ready, the version numbers will need updating, binaries built from the workflow, and a release vote done - see #8408 and https://lists.apache.org/thread/491tvp6o44nj9wpmcpbdtcmt8rn0d9h8
I'm currently -1 to the `PATH` modification - I'm not sure we can make that work everywhere it needs to. At least, prepend is going to break some existing things. Append is somewhat better but will not work in the cases mentioned earlier.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295517191
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -66,7 +69,11 @@ fi
export DEFAULT_USERDIR_ROOT
# #68373: look for userdir, but do not modify "$@"
-userdir="${netbeans_default_userdir}"
+if [ -z "$NETBEANS_USERDIR" ]; then
Review Comment:
- use environment value, if defined as `--userdir` default
- if one specifies `--userdir` CLI argument explicitly it takes precedence
- otherwise the userdir (if specified) is inherited from parent process
- that way just typing `netbeans` in integrated terminal talks to itself via `CLIHandler`' using the same user dir
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295969137
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -66,7 +69,11 @@ fi
export DEFAULT_USERDIR_ROOT
# #68373: look for userdir, but do not modify "$@"
-userdir="${netbeans_default_userdir}"
+if [ -z "$NETBEANS_USERDIR" ]; then
Review Comment:
Sorry. I wanted to talk about `--userdir` CLI argument. Fixed by modifying [the comment](https://github.com/apache/netbeans/pull/8756#discussion_r2295517191).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3289163979
Thank you for your review:
- let's only _append_ to `PATH` - that's gentle
- KISS: more complex architectures only if something really gets broken
I'll wrestle with the `.exe` and update docs now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2403772977
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
> appending would be less likely to break things
Right.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2407887323
##########
nb/o.n.upgrader/arch.xml:
##########
@@ -621,6 +621,43 @@
clusters' fully qualified paths separated by path.separator (semicolon on Windows, colon on Unices)
</api></li>
</ul>
+ <p>
+ When the <code>netbeans</code> launcher starts, it also manipulates
+ (reads and writes) following properties:
+ </p>
+ <ul>
+ <li><api name="NETBEANS_USERDIR" category="devel" group="property" type="export">
+ <p>
+ If this <em>environment variable</em> is set to a valid value,
+ then its value is used as default user dir
+ instead of <code>netbeans_default_userdir</code> read from
+ the config file.
+ </p>
+ <p>
+ When the value of user dir is finally determined by the launcher
+ (by considering default values, value of this environment variable
+ and <code>--userdir</code> CLI switch, etc.) the launcher sets
+ <code>NETBEANS_USERDIR</code> environment variable for itself
+ and its subprocesses.
+ </p>
+ <p>
+ That way executing <code>netbeans</code> in the NetBeans internal
+ terminal will know what's the userdir of the surrouding NetBeans
+ and will open files in the same instance just as
+ <a href="https://github.com/apache/netbeans/pull/8756">#8756 illustrates</a>.
+ </p>
+ <p>
+ The launcher also modifies the <code>PATH</code> variable
Review Comment:
Should this be split of into its own listitem?
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -65,8 +65,17 @@ fi
export DEFAULT_USERDIR_ROOT
+if ! [ "$NETBEANS_USERDIR" = "nope" ]; then
Review Comment:
When reading this I was thinking "What is the meaning of this?". And the only explanation I could find was slang for "no". If that is the case, I would advice against it. I think "IGNORE", "DISABLED" or something similar, more formal would be clearer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2416172058
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -65,8 +65,17 @@ fi
export DEFAULT_USERDIR_ROOT
+if ! [ "$NETBEANS_USERDIR" = "nope" ]; then
Review Comment:
OK, changed to `IGNORE` in 1e13163
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3389096231
Thanks!
> * who's architected such a crappy design?
>
> * in my architect's view, applauncher should only depend on nbexec, but not the IDE's launcher!
>
> * the fact that it is not the case, deserves some code changes
Matthias made similar comments on the PR I linked to above - https://github.com/apache/netbeans/pull/8408#issuecomment-2790212755
Short term, it's possibly better to align the behaviour on this for the platform as well anyway? ie. update the platform shell launcher rather than further changes in the Windows launcher. Could be just as useful for platform applications.
Longer term if you're considering re-architecting, for info, there was some discussion on the NB Slack channel a while ago about the possibility of using a Java file launcher instead that could run either as single Java source or be native compiled. That's tangential to this PR obviously.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2418692151
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,12 +38,18 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
-case "`uname`" in
+case "`uname -s -m`" in
Darwin*)
# set default userdir and cachedir on Mac OS X
DEFAULT_USERDIR_ROOT="${HOME}/Library/Application Support/NetBeans"
DEFAULT_CACHEDIR_ROOT=${HOME}/Library/Caches/NetBeans
;;
+ CYGWIN*_64)
+ exec $progdir/netbeans64.exe $*
Review Comment:
Right. Done in 54edd84
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "jtulach (via GitHub)" <gi...@apache.org>.
jtulach commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2347152969
##########
nb/ide.launcher/windows/nblauncher.cpp:
##########
@@ -114,6 +128,18 @@ int NbLauncher::start(int argc, char *argv[]) {
if (!userDir.empty()) {
newArgs.add(ARG_NAME_USER_DIR);
newArgs.add(userDir.c_str());
+ if (!skipUserDir) {
+ string toSet = ENV_NETBEANS_USERDIR;
+ toSet = toSet + "=" + userDir;
+ putenv(toSet.c_str());
+
+ const char* path = getenv("PATH");
+ if (path != NULL) {
+ string setPath = "PATH=";
+ setPath = setPath + path + ";" + baseDir + "\\bin\\";
+ putenv(setPath.c_str());
Review Comment:
I tested these changes with following program:
```java
package execenv;
public class ExecEnv {
public static void main(String[] args) throws Exception {
System.out.println("Env: " + System.getenv("PATH"));
var p = new ProcessBuilder("netbeans", "S:\\readme.txt").start();
var r = p.waitFor();
System.out.println("Res: " + r);
}
}
```
when executed on NetBeans 27 it fails with:
```
run:
Env: C:\Program Files\OpenSSH\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Users\jst\.cargo\bin;C:\Users\jst\AppData\Local\Microsoft\WindowsApps;C:\Users\jst\AppData\Local\nvm;C:\nvm4w\nodejs;C:\Program Files\Git\bin;S:\windows\bin;S:\windows\bin\graalvm-community-openjdk-24.0.1+9.1\bin\;S:\windows\bin\sbt-1.7.2\bin\;
Exception in thread "main" java.io.IOException: Cannot run program "netbeans": CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1044)
at execenv.ExecEnv.main(ExecEnv.java:6)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.base/java.lang.ProcessImpl.create(Native Method)
at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:485)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:146)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1076)
... 2 more
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\jst\AppData\Local\NetBeans\Cache\27\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 1 second)
```
With changes in this PR it **properly opens the file** in the IDE executing the script.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2295581421
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
Why append and not prepend? If anyone has `netbeans` in the `PATH`, which will include anyone who has installed DEB or RPM versions, and is running an alternative version then this will launch the default instead?
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -66,7 +69,11 @@ fi
export DEFAULT_USERDIR_ROOT
# #68373: look for userdir, but do not modify "$@"
-userdir="${netbeans_default_userdir}"
+if [ -z "$NETBEANS_USERDIR" ]; then
Review Comment:
I'm not sure what that has to do with `jdkhome` ? We should take `jdkhome` into account, which might be better handled by ensuring `JAVA_HOME` is set inside the launcher. This is the parallel of #8725 It would be another reason for ensuring that value is set to `jdkhome` inside the IDE.
The DEB and RPM launchers already do this - very useful to pick up the JDK the IDE is running on.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3242962380
> I am a bit worried about the can of worms this opens (why is javac, mvn, ant etc not in path too etc) and that it is set by default without opt-in or out.
+1
> I am wondering if `PATH` is even the right vehicle for this. Letting the NB terminal run `alias nb=NB_LAUNCHER_PATH` on start might have the smallest risk for side effects and cover the intended usecase.
I hadn't thought about setting an alias based on the environment variable, but that's a good idea. I think, set up something like `NB_BASEDIR` and `NB_LAUNCHER` in the launchers, and the rest can be addressed elsewhere in the codebase over time. It might actually be good to have a customizable script in the userdir that is invoked similarly to `~/.profile` and could be used to set up aliases. There's a few other setup things done - here iirc - https://github.com/apache/netbeans/blob/master/ide/dlight.terminal/src/org/netbeans/modules/dlight/terminal/action/TerminalSupportImpl.java#L269
But in the shorter term, the environment variable could still be invoked directly or used to set an alias manually.
Having basedir in there too could allow for pointing aliases at some of those other things you mentioned, should people wish to.
The launcher variable would need to be kept separate to the basedir, and only set if not already configured, so the various package scripts can use it to route through themselves.
> and it could have NB_DEFAULT_JDK etc too in future)
Maybe. Some of the packages set `JAVA_HOME` here, and I think that could be good in the launchers. That does count as a situation where the terminal in the IDE may behave differently to the system mind you (though probably rightly IMO).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Open file from embedded terminal, easily! [netbeans]
Posted by "neilcsmith-net (via GitHub)" <gi...@apache.org>.
neilcsmith-net commented on code in PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#discussion_r2311892066
##########
nb/ide.launcher/unix/netbeans:
##########
@@ -38,6 +38,9 @@ cd "$progdir"/..
basedir=`pwd`
cd "$old"
+# make sure own launcher is on PATH
+PATH=$PATH:$progdir
Review Comment:
Setting an environment variable for the basedir and/or the executable file path isn't unusual. If using it directly feels unusual, then a separate script could be used to do this.
The problem is anything that already puts `netbeans` on the `PATH`. If you are running an alternative (zip) version with an appended `PATH` then you'll get the default install. That may still do the right thing in most cases, once they have a version of NetBeans with the launcher that understands `NETBEANS_USERDIR` included. I've no idea if other Linux packages play around with `userdir`, although they may also not put `netbeans` on the `PATH`, but the `DEB` and `RPM` don't do anything.
If the `netbeans` location is prepended, then using the installed RPM or DEB packages this would cause calls to `netbeans` to go directly to `/usr/lib/apache-netbeans/bin/netbeans` rather than via `/usr/bin/netbeans` which would in some cases fail due to missing extra configuration.
In all, I have reservations about modifying the `PATH`, but appending would be less likely to break things while not working in all scenarios. Environment variables feel a little more reliable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "mbien (via GitHub)" <gi...@apache.org>.
mbien commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3942538362
> NETBEANS_USERDIR=IGNORE doesn't seem to work since it will cause NB instances started from the terminal to use IGNORE as user dir.
from NB 29 terminal:
```
~/dev/netbeans_29/bin/netbeans README.md
```
Will open the readme in NB 29 (or any dev version of 29 or later), like it is expected from terminals (so would aliases if you use them etc).
For the next step I recommend to `cd` into `/tmp` to avoid file pollution at current path:
Now try this again with the opt-out `NETBEANS_USERDIR=IGNORE` set and check the log:
```
User Directory = /tmp/IGNORE
Cache Directory = /home/mbien/.cache/netbeans/29
```
userdir will be a relative path based on the terminal context path since the opt out key is influencing NB startup.
NB 28 and below works as before since it doesn't have the launcher changes yet.
```
~/dev/netbeans_28/bin/netbeans README.md
```
-> the opt out itself has undesired side effects.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "priyanahata (via GitHub)" <gi...@apache.org>.
priyanahata commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3946830606
do you guys need an llm on the nb terminal?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
Re: [PR] Make sure netbeans in embedded terminal means itself [netbeans]
Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #8756:
URL: https://github.com/apache/netbeans/pull/8756#issuecomment-3452292129
I think we can go on with this. `ideopen` is slightly broken, but I would have preferred to have it fixed. That this does not work for subshells or other programms is less an argument as that is also true for this change as that will break after running an ssh connection.
On the other hand it also looks sane enough and I'm not willing to make this a fight.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists