Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not a real terminal somehow #158

Open
MrRedRhino opened this issue Oct 12, 2024 · 2 comments
Open

Not a real terminal somehow #158

MrRedRhino opened this issue Oct 12, 2024 · 2 comments

Comments

@MrRedRhino
Copy link

Hello, I am trying to run a Minecraft server with this library to emulate a real shell to get autocomplete in its console. I tried using JediTerm to run the server start command manually which works how i want it. But when using the code below, the server does not produce suggestions when sending tab keys. It also complains that WARN StatusConsoleListener Advanced terminal features are not available in this environment. I'm clueless what JediTerm does differently to make that work, that my code doesnt do.

HashMap<String, String> env = new HashMap<>(System.getenv());
env.put("TERM", "xterm-256color");
PtyProcess ptyProcess = new PtyProcessBuilder()
        .setEnvironment(env)
        .setDirectory(Config.mcServerDirectory())
        .setCommand(new String[]{"/bin/bash", "--login"})
        .start();
ptyProcess.onExit().thenAccept(process -> {
    state = State.STOPPED;
    LOGGER.info("Server stopped");
});
new Thread(() -> handleConsoleInput(ptyProcess), "Console Reader").start();
ptyProcess.outputWriter().write("/home/pipeman/.jdks/zulu21.32.17-ca-jre21.0.2-linux_x64/bin/java -jar paper-1.21.1-120.jar nogui\n");
ptyProcess.outputWriter().flush();
@segrey
Copy link
Collaborator

segrey commented Oct 13, 2024

Thanks for reporting. Could you please provide more details on how you setup the Minecraft server?

@MrRedRhino
Copy link
Author

MrRedRhino commented Oct 13, 2024

I just downloaded the executable jar from https://papermc.io/downloads/paper and placed it in a folder. To test it with JediTerm i cloned the JediTerm repo and executed its Main class. Then I typed the command from the second to last line im the code above into the JediTerm window: /home/pipeman/.jdks/zulu21.32.17-ca-jre21.0.2-linux_x64/bin/java -jar paper-1.21.1-120.jar nogui

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

No branches or pull requests

2 participants