Skip to content

ARTEMIS-6051 Change artemis shell history defaults to ~/.artemis_history#6426

Open
clebertsuconic wants to merge 1 commit into
apache:mainfrom
clebertsuconic:ARTEMIS-6051
Open

ARTEMIS-6051 Change artemis shell history defaults to ~/.artemis_history#6426
clebertsuconic wants to merge 1 commit into
apache:mainfrom
clebertsuconic:ARTEMIS-6051

Conversation

@clebertsuconic
Copy link
Copy Markdown
Contributor

It is possible to change the artemis-utility.profile as well

@jbertram
Copy link
Copy Markdown
Contributor

jbertram commented May 8, 2026

The changes appear to be relevant only for Linux. How will this be handled on Windows?

@clebertsuconic
Copy link
Copy Markdown
Contributor Author

I was going to leave windows out. The bash history thing seemed a Linux concept to me.

I'm not even sure how to guarantee security settings in windows.

@clebertsuconic
Copy link
Copy Markdown
Contributor Author

@jbertram I just tested on Windows. I think the best decision for now is to not add a default on windows. On Linux this is very well defined.

@jbertram
Copy link
Copy Markdown
Contributor

So does this mean that the default history file which used to be <instance>/etc/history-file on both Linux and Windows will now be ~/.artemis_history but only on Linux and now Windows won't have a default history file?

@clebertsuconic
Copy link
Copy Markdown
Contributor Author

that's what I was doing..

I can keep the current behavior if no variable is defined.. meaning it would be the same as it is now on windows.

@clebertsuconic
Copy link
Copy Markdown
Contributor Author

@jbertram Kept the previous semantic for windows or in case the user removes the definition.

@clebertsuconic
Copy link
Copy Markdown
Contributor Author

I just tested on windows and it worked...

(the shell is not a very good experience on windows through.. tab does not work, CTRL-C is not captured and it interrupts the shell... all windows normal stuff.. don't know if it can be improved but that would be a separate task, probably to be improved on the Picco anyway).

@jbertram
Copy link
Copy Markdown
Contributor

This looks good. However, it would be nice to have some tests around the history file, especially confirming the permissions are set appropriately. I think you can mock input similar to the recently added org.apache.activemq.artemis.cli.commands.CreateTestIndividualSettings#testMaskAdminPasswordUserInput .

@clebertsuconic
Copy link
Copy Markdown
Contributor Author

@jbertram these tests are mostly UI.

I saw the test you added.. but that's a very specific thing. when you start testing navigation through UI and stuff.. I'm not sure we should keep the test strict.

I can add a test validating the security settings.. however that will be mostly on LInux as those settings don't apply to Windows.

@clebertsuconic
Copy link
Copy Markdown
Contributor Author

@jbertram that shell thing is a terminal / UI thing.

I could not find a way to test / validate the functionailty other than UI test it.

The terminal is using a PiccoCLI library that's using native calls to setup the terminals and input / output directly with the keyboard.

If I created a piped input to simulate input / output, I wouldn't be actually testing that portion.

some part of the CLI are using System.input to ask certain defaults.. and those parts are possible to validate.

i will write a test to simulate the creation of the file, but I won't be able to do a full Shell test because of this limitation.

@clebertsuconic clebertsuconic force-pushed the ARTEMIS-6051 branch 2 times, most recently from 23a072a to 96d168d Compare May 11, 2026 16:30
Comment thread artemis-cli/src/test/java/org/apache/activemq/artemis/cli/commands/ShellTest.java Outdated
It is possible to change the artemis-utility.profile as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants