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

Add system to standard word search list such that calling exit/(exit) does not first issue an error #2937

Closed
nomennescio opened this issue Jan 25, 2024 · 20 comments
Assignees

Comments

@nomennescio
Copy link
Contributor

Exiting the (UI) listener is a basic operation. Add system to the standard word search order, so the user can exit without getting annoying error messages.

@mrjbq7
Copy link
Member

mrjbq7 commented Jan 25, 2024 via email

@razetime
Copy link
Member

Ctrl-D doesn't close the UI. Ctrl+Q or Alt+F4 may work.

@mrjbq7
Copy link
Member

mrjbq7 commented Feb 9, 2024

Does the user think exit would close the whole Factor process, or just the UI Listener window that its being typed into?

@nomennescio
Copy link
Contributor Author

nomennescio commented May 3, 2024

Does the user think exit would close the whole Factor process, or just the UI Listener window that its being typed into?

I don't know of course, but having used quite some interpreters, typing a keyword to close everything is pretty standard.
Personally I find it annoying to switch to mouse and click multiple windows (Browser, Walker, tons of Inspectors) to close everything. Keyboard shortcuts like Alt+F4 don't close all other Windows. CTRL-Q does indeed close other Windows.

CTRL-Q is bound to com-exit, which calls 0 exit. So indeed a valid shortcut. It is however not really documented; the documentation on https://docs.factorcode.org/content/article-ui-shortcuts.html describes a keybinding:
⌘Q to "Exit | com-exit", with a , not CTRL

I still think exit is the commonly typed keyword for people who have little clue (the other one is typically quit, but that one is much more overloaded in Factor) and want to exit a shell or interpreter. I want to prevent the VIM-syndrome where exiting it is so uncommon it has become its own meme.

@nomennescio
Copy link
Contributor Author

Searching through the vocabs, the only other vocab that defines exit is cuda.ptx, where it is a tuple.

Looking at the command-line listener, return is required to "exit" it (https://docs.factorcode.org/content/article-listener.html), which is a bit uncommon, but then again, it's not a common way to run Factor, so that is less of a concern.

Maybe the more elegant solution is to introduce an alias in the UI Listener for com-exit; it won't affect existing code, doesn't introduce all system words in the global vocab search space, and is limited to the UI Listener only, and only clashes if the user explicitly loads system in scratchpad and defines words with that.

I'll make a pull request out of that, and then you can comment on that, and if you agree accept it, or reject it. Then I'll close this issue.

@nomennescio nomennescio self-assigned this May 9, 2024
@nomennescio
Copy link
Contributor Author

nomennescio commented May 9, 2024

Hmm, just adding the alias to ui.tools.factor still does not make it immediately available to the standard search path. OK, I'll think of something else.

@mrjbq7
Copy link
Member

mrjbq7 commented May 9, 2024 via email

@nomennescio
Copy link
Contributor Author

What’s wrong with Ctrl-D for EOF?Works in command line and UI listeners?

As noted CTRL-D does not work on Windows to exit Factor (see above)
And I want a command to help people who expect a command to exit Factor, not a key-combo

@mrjbq7
Copy link
Member

mrjbq7 commented May 9, 2024

But they likely don't expect it to exit Factor, they likely expect it to exit one of the listener windows, no?

@mrjbq7
Copy link
Member

mrjbq7 commented May 9, 2024

How do you type an EOF on windows?

@nomennescio
Copy link
Contributor Author

nomennescio commented May 9, 2024

How do you type an EOF on windows?

CTRL-Z if you're on cmd.com, but that's never used to close a console. On Cygwin and MSys, it's CTRL-D.

@nomennescio
Copy link
Contributor Author

But they likely don't expect it to exit Factor, they likely expect it to exit one of the listener windows, no?

As I said, I find that hard to predict; typically people start an interpreter from the commandline (factor.exe) with a keyboard, then also expect to exit using a keyboard command. People who start it by double-clicking on icon with the mouse, expect it to close with the mouse. Both scenarios happen. People using universally an EOF char to close things is not very common outside Unix.

@nomennescio
Copy link
Contributor Author

With the solution for #3004 , CTRL-Q closes the Factor Windows and properly handles calls to be handled at window closure (ungraft*). Given that exit bypasses all Windows handlers, for the UI I don't consider exit the preferred way to exit the UI anymore.

Therefore the word to properly end the listener is com-exit

Maybe we can have an easier to remember ALIAS: for that?

@nomennescio
Copy link
Contributor Author

I propose quit for that, it's used only in a few other vocabs to quit a special application, so that will hardly lead to troublesome clashes.

@nomennescio
Copy link
Contributor Author

a50f45c

@mrjbq7
Copy link
Member

mrjbq7 commented May 29, 2024 via email

@mrjbq7
Copy link
Member

mrjbq7 commented May 29, 2024 via email

@mrjbq7
Copy link
Member

mrjbq7 commented May 29, 2024 via email

@mrjbq7
Copy link
Member

mrjbq7 commented May 29, 2024

Reverting, ui.tools isn't even in the default search path.

if you need this you can make an alias in your factor-rc / factor-boot-rc.

@mrjbq7
Copy link
Member

mrjbq7 commented May 29, 2024

Ctrl-D works on windows

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

3 participants