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

Implement new Erlang shell #6144

Merged
merged 34 commits into from
Aug 31, 2022
Merged

Commits on Aug 29, 2022

  1. Configuration menu
    Copy the full SHA
    3e4baae View commit details
    Browse the repository at this point in the history
  2. erts: Fix writing to std handler when detached

    When writing using erlang:display* when detached the
    write operation would return an error on windows. So
    we make sure that the handles are valid so that they
    can always be written to.
    garazdawi committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    0fc5475 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e53f0ea View commit details
    Browse the repository at this point in the history
  4. kernel: Remove shell:whereis_evaluator

    shell:whereis_evaluator was only used by the pman application
    but was not removed when that application was removed.
    garazdawi committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    d289ca2 View commit details
    Browse the repository at this point in the history
  5. stdlib: Fix ancestors for group and shell

    This makes observer better at drawing the application tree
    garazdawi committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    516b3bf View commit details
    Browse the repository at this point in the history
  6. stdlib: Allow any Key/Value in io:setopts

    The protocol replies enotsup for any unkown, so we can
    send unknown terms. This is useful when we want to be able
    to extend the options allowed to be sent.
    garazdawi committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    707c8aa View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    f586260 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e8849e6 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9fff925 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    6209f14 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    4042a96 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    1da39b4 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    bf4d035 View commit details
    Browse the repository at this point in the history
  14. kernel: Make sure user is registered when start returns

    In order to avoid spinning in `user_sup` we start user
    during the synchronous phase of `user_drv` startup.
    
    See erlang#4895 for more details
    garazdawi committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    c259e39 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    bcb7b0c View commit details
    Browse the repository at this point in the history
  16. erts: Re-Implement shell using nif

    This commit re-implements the entire tty driver for both Unix
    and Windows to use a common nif instead of two seperate drivers.
    
    The Unix implementation works pretty much as it did before only that
    a lot more of the terminal logic has been moved from Erlang to C.
    
    The windows implementation now uses Windows Terminal Sequences, i.e.
    the same sequences as most Unixes to control the terminal. This means
    that werl.exe is no longer needed and erl.exe will have the "newshell"
    with all the features normally only found on Unix.
    
    The new implementation also uses dirty I/O threads for all I/O which
    means that it can leave the FDs in blocking mode. This fixes problems
    when the Erlang tty is interacting with other systems such as bash.
    
    Closes erlang#3150
    Closes erlang#3390
    Closes erlang#4343
    garazdawi committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    bd0865f View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    7159bb8 View commit details
    Browse the repository at this point in the history
  18. kernel: Change -noshell and -noinput to use user_drv

    We want as much of the I/O work as possible to go through
    the user_drv as it will use dirty I/O schedulers to schedule
    the work. Also this makes the unicode detection work even
    for -noshell/-noinput type systems.
    
    This commit also adds user_drv:start_shell/0 to allow the user
    to start the shell after the fact. For instance when rebar3
    starts as en escript it may want to start a shell depending on
    what arguments are given to it.
    garazdawi committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    669ad5e View commit details
    Browse the repository at this point in the history
  19. kernel: Introduce terminal io:getopts option

    This is useful to have when checking if the target of
    output is a terminal.
    garazdawi committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    d342869 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    d4d5eff View commit details
    Browse the repository at this point in the history
  21. erts: Reset tty when child_setup exits

    If the cleanup code in sys_tty_reset is never run it can leave
    the terminal in a broken state. The cleanup code is not executed
    if erts receives a SIGKILL or if Ctrl-C is pressed when +B is started.
    
    Closes erlang#3150
    garazdawi committed Aug 29, 2022
    Configuration menu
    Copy the full SHA
    5bb3884 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    e276c69 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    cb47b4d View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2022

  1. Configuration menu
    Copy the full SHA
    e8e632c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    590aea1 View commit details
    Browse the repository at this point in the history
  3. erts: Clear fallback flag when stopping select

    Not clearing it triggered the assert below when stdin
    was deselected.
    garazdawi committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    e413dc2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e30cc88 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f306c48 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    36ec67b View commit details
    Browse the repository at this point in the history
  7. stdlib: Fix escript SUITE

    Argument parsing by init is a bit naive. In the escript testcase
    "-noshell xxxx...." was interpreted as the "-noshell" flag being
    given the value "xxxx....". So to fix this, we push the "-boot file"
    argument last and thus "xxxxx" will be seen as a separate argument
    as it should.
    garazdawi committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    77835e0 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8895c48 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    fbc7ff3 View commit details
    Browse the repository at this point in the history
  10. erts: Fix so that prim_tty can be reloaded

    This is needed for when prim_tty is cover compiled.
    garazdawi committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    75bfdc4 View commit details
    Browse the repository at this point in the history
  11. kernel: Fix loading of prim_tty nif in embedded mode

    When running in embedded mode the on_load function is called
    by the init process after the user processes are started. So
    we add a way for user to call the on_load function earlier
    in the boot sequence so that the shell can be started when
    it should.
    
    We cannot move the on_load calls for all modules to an earlier
    place in the kernel boot sequence as the code in on_load may
    depend on kernel services being started.
    garazdawi committed Aug 31, 2022
    Configuration menu
    Copy the full SHA
    945b37f View commit details
    Browse the repository at this point in the history