0

I use xinit to start X with wm - startx command that using .xinitrc to invoke X11 environment, but when X starts, there a black screen with cursor staying there for few seconds before X is fully started and if I press ctrl-c to interrupt the process, it will drop to shell, meaning user always has a way to go into shell - how to disable this ability?

2
  • Did you try wm - startx & to run it as a background task? Commented Mar 5, 2019 at 3:51
  • @Zhro: I just use .profile to startx, what's difference with your command? I'll try and give feedback. Commented Mar 5, 2019 at 7:47

1 Answer 1

0

The issue here is that you're calling startx in the foreground. If you want it to run in the background and not be susceptible to ctrl-c then append & at the end of the command.

For example:

sleep 3s && echo 1

This command will sleep for three seconds and then echo 1 to standard output. As it is in the foreground, you can interrupt it with ctrl-c.

Alternatively, you can continue to work on other things in the foreground while it runs in the background until either you log out or it terminates:

sleep 3s && echo 1 &

See here for more examples:

https://www.cyberciti.biz/faq/unix-linux-jobs-command-examples-usage-syntax/

If you are just running startx then try replacing it with startx &.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.