To clear screen, GEF runs clear command in my SHELL . This behavior is unexpected because
clear that is expects is a binary from ncurses and can be looked up from PATH without involving my shell
nobody guarantees GEF that my shell is POSIX-compatible and things it do with my shell will work
nobody guarantees GEF that clear command from my shell with my random environment is clear it expects. In my case it's Nushell's built-in which has different set of flags, so GEF breaks trying to run it.
That's because GEF supposes using GDB's shell command to be acceptable, which is obviously invalid, because GDB's shell command runs binary it knows nothing about (which is my shell) as it's Bash, which is invalid behavior by definition, but obviously won't be fixed in near future because it will break backward compatibility of GDB. For running guaranteed POSIX-compatible shell people have their /bin/sh.
Do you read the docs and look at previously closed issues/PRs for similar cases?
Yes
Architecture impacted
[ ] X86
[X] X64
[ ] ARM
[ ] ARM64
[ ] MIPS
[ ] MIPS64
[ ] PPC
[ ] PPC64
[ ] RISCV
Describe your issue. Without a proper reproduction step-by-step, your issue will be ignored.
Install Nushell as your default shell
Run GEF
Setup any layout with views. In my case it was done by gef config context.layout "regs code" and running the program.
Encounter the issue because clear in Nushell doesn't have -x flag
Minimalist test case
Not applicable. The issue is obviously testable with any code.
Additional context?
Nushell's error as a witness that thing broke:
Error: nu::parser::unknown_flag
× The `clear` command doesn't have flag `-x`.
╭─[source:1:8]
1 │ clear -x
· ┬
· ╰── unknown flag
╰────
help: Available flags: --help(-h), --all(-a). Use `--help` for more information.
@liferooter
We've changed the way we clear the screen. The new way is not only more portable, but also more performant, and should work in your case. Feel free to re-open the issue if not
GEF+GDB version
Operating System
NixOS Linux
Describe the issue you encountered
To clear screen, GEF runs
clear
command in mySHELL
. This behavior is unexpected becauseclear
that is expects is a binary fromncurses
and can be looked up fromPATH
without involving my shellclear
command from my shell with my random environment isclear
it expects. In my case it's Nushell's built-in which has different set of flags, so GEF breaks trying to run it.That's because GEF supposes using GDB's
shell
command to be acceptable, which is obviously invalid, because GDB'sshell
command runs binary it knows nothing about (which is my shell) as it's Bash, which is invalid behavior by definition, but obviously won't be fixed in near future because it will break backward compatibility of GDB. For running guaranteed POSIX-compatible shell people have their/bin/sh
.Do you read the docs and look at previously closed issues/PRs for similar cases?
Yes
Architecture impacted
Describe your issue. Without a proper reproduction step-by-step, your issue will be ignored.
gef config context.layout "regs code"
and running the program.clear
in Nushell doesn't have-x
flagMinimalist test case
Not applicable. The issue is obviously testable with any code.
Additional context?
Nushell's error as a witness that thing broke: