You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by GitBox <gi...@apache.org> on 2022/09/26 16:06:15 UTC

[GitHub] [karaf] awrb opened a new pull request, #1628: [KARAF-1381] - store karaf command history separately for each instance

awrb opened a new pull request, #1628:
URL: https://github.com/apache/karaf/pull/1628

   With this change (unless overriden via system properties for a given instance): 
   - `/home/user/.karaf/karaf.history` becomes `/home/user/.karaf/karaf.history.root`,
   - then each instance has its own history stored in `/home/user/.karaf/karaf.history.{instanceName}`.


-- 
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: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [karaf] jbonofre commented on a diff in pull request #1628: [KARAF-1381] - store karaf command history separately for each instance

Posted by GitBox <gi...@apache.org>.
jbonofre commented on code in PR #1628:
URL: https://github.com/apache/karaf/pull/1628#discussion_r980869610


##########
shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java:
##########
@@ -299,7 +299,9 @@ public Object evaluate(LineReader reader, ParsedLine line, String func) throws E
      * @return the history file
      */
     protected Path getHistoryFile() {
-        String defaultHistoryPath = new File(System.getProperty("user.home"), ".karaf/karaf.history").toString();
+        String instanceName = System.getProperty("karaf.name", "root");

Review Comment:
   Yes, if instance name is `root`, it would be great to keep `karaf.history` for the name (for backward compatibility).



-- 
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: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [karaf] awrb commented on a diff in pull request #1628: [KARAF-1381] - store karaf command history separately for each instance

Posted by GitBox <gi...@apache.org>.
awrb commented on code in PR #1628:
URL: https://github.com/apache/karaf/pull/1628#discussion_r981391982


##########
shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java:
##########
@@ -299,7 +299,9 @@ public Object evaluate(LineReader reader, ParsedLine line, String func) throws E
      * @return the history file
      */
     protected Path getHistoryFile() {
-        String defaultHistoryPath = new File(System.getProperty("user.home"), ".karaf/karaf.history").toString();
+        String instanceName = System.getProperty("karaf.name", "root");

Review Comment:
   Done, it will stay `karaf.history` 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: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [karaf] awrb commented on a diff in pull request #1628: [KARAF-1381] - store karaf command history separately for each instance

Posted by GitBox <gi...@apache.org>.
awrb commented on code in PR #1628:
URL: https://github.com/apache/karaf/pull/1628#discussion_r980253676


##########
shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java:
##########
@@ -299,7 +299,9 @@ public Object evaluate(LineReader reader, ParsedLine line, String func) throws E
      * @return the history file
      */
     protected Path getHistoryFile() {
-        String defaultHistoryPath = new File(System.getProperty("user.home"), ".karaf/karaf.history").toString();
+        String instanceName = System.getProperty("karaf.name", "root");

Review Comment:
   Might want to keep `karaf.history` filename for the root instance for retrocompatibility? If so there needs to be a condition 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: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org