What is this "the bash feature"? Do you mean bash, as in the Bourne Again SHell? If so that's your primary command shell and a turing-complete programming environment unto itself, not a "feature" of or dependent in any way on some terminal emulator like konsole or GNOME whatever.is there a way to have bash write all content to a file as well as the screen while the bash feature is running?
From your image, you appear to be trying to capture the output of 'ls'... I don't know why you think you need a GUI terminal emulator, copy-paste, menus or a mouse to get output from CLI programs into a file (or anywhere else for that matter), redirecting text streams (and the composability that enables) is fundamental to all unix shells.
Getting the STDOUT of 'ls' into a file for example is as simple as
Code:
ls > output.txt
Code:
ls | tee output.txt
Code:
ls | head -n5 | tee output.txt
Code:
ls | grep "foo" | tee output.txt
Code:
ls | grep "foo" | sed 's/foo/bar/g' | tee output.txt
Code:
ls | tee output.txt | pastebinit
Code:
ls | tee >(pastebinit)
Code:
ls | ssh user@remotehost -T "cat > /tmp/output.txt"
Code:
exec > >(tee -a "output.txt") 2>&1
These concepts (and a lot more) are in
Code:
man bash
Similarly, manuals are available for the other commands involved, e.g. 'man tee' or 'man grep'.
Almost all CLI programs can be connected with pipes and redirection this way to build more complex functionality. Welcome to unix, where we can do most things 10x faster and more efficiently without a rodent in sight.

If what you really want is a full record of everything you do in a shell session (i.e. both your input and command output), try ruwolf's suggestion and use script. It's a good habit to get into anyway, particularly when upgrading a system or doing anything you may want to replay or reverse.
As for scrollback/screen buffers, those aren't part of the shell, they're a feature of the terminal and its graphics output stack... And not particularly reliable, accessible or portable at the best of times.
Statistics: Posted by steve_v — 2024-06-27 07:32 — Replies 2 — Views 70