on FreeBSD, how to exit from Gnome Session to Pure terminal mode - gnome

on FreeBSD, how to exit from Gnome Session to Pure terminal mode.
Thanks!

Try Ctrl+Alt+F2 key combination to go to text terminal, use Ctrl+Alt+F9 to come back to Gnome or whatever you are running on top of X.
If you want to totally disable X11 open /etc/ttys file, find the line that says:
ttyv8 "/usr/X11R6/bin/xdm -nodaemon" xterm off secure
comment it out, save the file and reboot.

Related

Mark mode in Terminal without mouse

Is it possible to enter mark mode(to mark text in Linux terminal) without mouse. In CMD you can ,alt+space+e+k. Can it be done natively without 3th party programs?
Regardless of your terminal you can enable vi mode for you shell, both bash and zsh support this.
A quick one (without installing third party programs) would be to set -o vi in your shell to enable vi and use the shortcuts
If you don't like it you can always come back to emacs: set -o emacs

Run program as a (linux style) foreground terminal process on windows?

does anyone know how to produce a similar result?(essentially tying the windows terminal to the open program)
For example, when you run "emacs" in bash (or another linux terminal) it will produce an output into the open terminal until the program is terminated (or silenced with emacs &)
I want to be able to reproduce this effect on windows, but have no idea how, running start(and similar commands) will only run the program in a new window, with a hidden command line, detached from the cmd line process.
You need the /B flag:
start /B myprogram
(Of course, this will only work with programs that actually use the console. If the program doesn't generate console output, this won't magically make it do so.)
You can do that by first installing Cygwin and then running emacs from Cygwin.
Cygwin is a collection of tools which provide functionality similar to a Linux distribution on Windows.
try typing edit into a windows command shell, it's actually a better program than notepad. there are versions of vi, emacs, for windows and dos, you could try any of them.
ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/
http://www.vim.org/download.php#pc

how to refresh entire screen in putty

I have a redhat machine which I use remotely using putty and this is what have been bugging me a lot now...
Each time I open and close a file with any editor, my prompt shows up on the bottom line without the content of the screen being refreshed. This is really problematic because then I can't see previous outputs that were on the screen just before I opened that file which is still showing up after closing.
Is there a way to fix this. I want it to behave like the gnome-terminal. I don't think this use to happen when I was using an ubuntu server.
I understand that this is the traditional tty behavior, but I don't want it...
Thanks in advance.
If your terminal supports an alternate screen buffer, it should have rmcup and smcup define in its terminfo entry
% infocmp | grep -e rmcup -e smcup
ri=\EM, rmacs=^O, rmcup=\E[2J\E[?47l\E8, rmir=\E[4l,
smcup=\E7\E[?47h, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[7m,
If enabling altscreen in your .screenrc doesn't fix it, try adding these 2 lines to your .vimrc:
set t_ti=^[[?47h
set t_te=^[[?47l
(note that ^[ is escape, I typed ctrl-v esc)
Vim will echo ti to the terminal on startup and te on exit, instructing the shell/xterm/screen to switch screen buffers.

How do I open a new window (shell) from command line in Linux?

I'm working with a tool right now that requires me to putty to a remote host, login, run a series of commands to start an engine, open a new window (and login again) to start a different engine, then open a third window (and again, login) to actually use the tool (leaving the engines running in those first two windows). I'd like to write a shell script to automate the process so that I could just open one window, type "sh whatever.sh" and be off and running, without physically opening the new windows and logging in again. However, I can't find a command to get me from one window to the next. Any thoughts?
You can just background the first processes by adding an ampersand (&) to the command line or pressing Ctrl+Z when it is running (and then enter bg to let the process continue, more information about that with jobs).
If that's not enough, you can create virtual shells with screen or tmux.
If you've redirected X (i.e. you can access GUIs over ssh), you can also just start a new window by executing your favorite (GUI) console program, like xterm, konsole, gnome-terminal, etc.
Are you familiar with jobs on linux?
nohup whatever_1.sh &
nohup whatever_2.sh &
nohup whatever_3.sh &
Or perhaps screen would be of use here:
https://serverfault.com/questions/25301/job-control-and-ssh
See also, nohup:
http://en.wikipedia.org/wiki/Nohup
The bash command opens a Bourne-again shell (bash) session.
Try typing in "konsole". That should open a new bash window and set the focus to it.
On my Ubuntu 18 I just type the command:
gnome-terminal
and a new shell opens... I don't like the above answers because xterm and konsole most likely not already be installed.
Shell script on target machine cannot be aware of putty windows on client machine.
Consider using Screen : http://www.gnu.org/s/screen/ - it is clean and powerful way.
I think you need command line window then write:
$ xterm
# new window started
If you need python in new window:
$xterm python
#now a window will shown with python shell
Another nice option from Xfce's terminal:
xfce4-terminal

Screen + vim causes shift-enter to insert 'M' and a newline

When running a vim instance in gnu screen hitting shift enter in insert mode adds an 'M' and then a newline, rather than just a newline.
Does anybody know what the problem might be, or where to look?
Relevant system info:
Ubuntu 8.04.1
Screen version 4.00.03 (FAU) 23-Oct-06
VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 31 2008 12:20:21)
Included patches: 1-138
Konsole 1.6.6 (Using KDE 3.5.10)
Thanks to the comments. When checking the value of $TERM I noticed that it was xterm (as expected), but within screen $TERM was set to screen-bce. Setting TERM=xterm after launching screen resolves this issue.
Adding the following to ~/.screenrc solved the problem without having to do anything manually:
term xterm
Missing info from your question:
Where do you run screen and see this issue? Some terminal app (KTerminal, Gnome terminal, virtual console etc) or remote session (eg putty, ssh from another computer)
do a “echo $TERM” and tell us its output
do a “cat -v”, press Shift-Enter, then Enter, then Ctrl-D and then tell us what is output.
First, you could fix your $TERM for within konsole. Install "ncurses-term" and configure konsole to set $TERM=konsole-256color. Then configure screen with "term screen-256color". Or 'konsole' and 'screen', respectively, if that's your preference. Konsole and screen are not xterm and doesn't support everything xterm does, so using incorrect $TERM can lead to bad things.

Resources