Page 1 of 1

Terminal command to exit to prompt

Posted: Mon Jan 02, 2023 3:59 pm
by Subito Piano

Hi! I'm writing a script to logout and exit X to the command prompt after so long a time. Does anyone know the command to quit X under JWM and get back to the prompt, so I can restart X by typing "xwin"? The command "jwm -exit" kills X but leaves only a blinking cursor, ditto for "wmexit," nor does "pkill" work.

Thanks!


Re: Terminal command to exit to prompt

Posted: Mon Jan 02, 2023 6:04 pm
by Subito Piano

Hmm -- it turns out there must be a kink in my system. On another install of XenialPup on the same laptop, "jwm -exit" exits X and drops to the command line. That said, am I logged out or still logged in as root?

FWIW, on my regular install of XenialPup, although "jwm -exit" does not drop to the command line, MENU>LOGOUT>EXIT TO PROMPT does do that....


Re: Terminal command to exit to prompt

Posted: Mon Jan 02, 2023 10:10 pm
by some1
Subito Piano wrote: Mon Jan 02, 2023 3:59 pm

nor does "pkill" work.

Did you mean
pkill x


Re: Terminal command to exit to prompt

Posted: Mon Jan 02, 2023 10:23 pm
by williwaw

what puppy are you using? not all do the same. viewtopic.php?p=8353&hilit=tty+terminal+F2+getty#p8353

you might have to research how to find the keyboard command equivalent to use in a script


Re: Terminal command to exit to prompt

Posted: Mon Jan 02, 2023 10:29 pm
by gychang
Subito Piano wrote: Mon Jan 02, 2023 6:04 pm

Hmm -- it turns out there must be a kink in my system. On another install of XenialPup on the same laptop, "jwm -exit" exits X and drops to the command line. That said, am I logged out or still logged in as root?

try whoami


Re: Terminal command to exit to prompt

Posted: Mon Jan 02, 2023 11:22 pm
by Subito Piano

@some1: "pkill x" reboots the system, not what I'm looking for.

@willwaw: I'm using xenialpup in both instances -- that is, my day-to-day xenialpup install is corrupted, but another xenialpup install that happens to be on the same laptop works fine. Of course, I can reinstall puppy or tweak the other install if it comes to that. (Also, I have poked around the net for an answer, I try to do that myself before posting on a forum for assistance. JWM is great, but relatively few use it, so there is not a lot of troubleshooting posts in the various distro forums)

@gychang: good to know, thanks. Why didn't I think of that? :lol:


Re: Terminal command to exit to prompt

Posted: Tue Jan 03, 2023 1:43 am
by williwaw

That said, am I logged out or still logged in as root?

at the blinking cursor, try ctrl+c or crtl+d. if that drops you into a prompt, you may be in a login shell where you could try root then woof woof

I have run programs as no user at all, it's not really all that useful, but viewtopic.php?t=6335 may give you some ideas of the limited capabilities of terminal


Re: Terminal command to exit to prompt

Posted: Tue Jan 03, 2023 2:54 am
by Subito Piano

Well...CTRL+C and CTRL+D didn't work -- and at any rate, now it's a moot point. Experimenting, I renamed my .config folder and rebooted, to see if the issue was in my personalized configurations. When I rebooted I got the message that my Choices had been moved -- an easy fix to move them back, but silly me, I made a few mistakes (moving faster than thinking?) and now it will need a bit of work to get it tweaked the way I like....and it will still have the logout problem. At this point I'll either start over with a fresh install or take another xenialpupsave I keep on my USB stick and copy it to this laptop, then adjust as necessary. This is not my main laptop anymore, there's no rush for me, plus most of my files are on a separate partition, and I should still be able to access anything I need from my old pupsave, the one that won't exit to prompt.

Thanks to all for your thoughts. ;-)


Re: Terminal command to exit to prompt

Posted: Tue Jan 03, 2023 9:26 am
by williams2

wmexit has a bug in Xenial and Bionic.

The bug is fixed in FoassaPup and later versions of Woof ce.

If the window manager is started from a script or from a compiled executable
wmexit can not kill the process because it is no longer executing.

oir example, if you type xwin jwn
it can try to run jwn but it's a typo,
it should be xwin jwm not xwin jwn

Puppy will try to execute the error,
but it can't, so it will execute jwm as the default.
But to shut down Xwindows it will try to kill the typo jwn

For common window managers like jwm, icewm, xfce. Puppy can kill them automatically.
from the wmexit script.

The bugfix kills X or Xorg if killing the window manager doesn't work.
before the bug fix, shutting down X would just hang,

The behaviour you are describing can be caused by a typo in /etc/windowmanager
among other problems.
FossaPup will shut down X normally.
XenialPup and BionicPup will hang

killall jwm should work in most Pups.

xwim contain some of the default interaction that you see on the command ine.