Terminal Love

My main terminal application is x11/evilvte, but I'm really enjoying sysutils/tmux a lot - there are times for tabs, and there are times when I need it all right there. I'm not a fan of alt-tab for TTYs. What terminal add-ons or tweaks do other people use/like?
 
FWIW, I currently do the vast majority of my stuff from one or two central machines, both of which run X with virtual desktops. So I just have some terminals open on any virtual desktop where I need them. I do like tmux though, and before that came along I used sysutils/screen a lot.

For some reason I do have a perhaps somewhat pathological urge to install games/sl on every machine :h Oh, and being a vimer I like misc/vifm. Whoever mentioned that thing on these forums some time ago, thanks again :f
 
At first I heavily used screen on my Linux servers, but after I migrated all my Linux (CentOS) servers to FreeBSD I also quickly discovered and embraced sysutils/tmux. Which reminds me that I really need to finish the second part of my 'tmux tutorial'.

Alas; I've became a big fan of tmux due to the very slick way in which it's set up (for example no more need for a setuid binary) and it's extensive and flexible configuration options. Control-a and control-C will take me right into vi with ~/tmux.conf loaded for editing. Control-a and control-r will then re-load said config file (and of course (re-)apply any configuration options).

Even better: all those manually added commands are also mentioned and shown whenever I press control-a + ?. So when I pull up the help screen.

It's things like that which made me a firm tmux supporter. Which is basically the only thing I'm using on my servers. Apart from /bin/sh, /usr/local/bin/ksh and of course /bin/csh :)
 
fonz said:
For some reason I do have a perhaps somewhat pathological urge to install games/sl on every machine :h
Darn you! ;)

SO after I approached this probably 'evil' port with great care (running # make missing to look for a good excuse not to try it for example) I eventually installed it as well. Now, I don't really make much typing mistakes, but after that first animation on my (non-X11) server I was hooked as well :)

Really funny and very well made.

But of course I now have to blame you for pointing out the funny :)
 
ShelLuser said:
Control-a and control-C will take me right into vi with ~/tmux.conf loaded for editing. Control-a and control-r will then re-load said config file (and of course (re-)apply any configuration options).

What do you use to go to the beginning of the prompt line if Control-a is taken by tmux?
 
jrm said:
What do you use to go to the beginning of the prompt line if Control-a is taken by tmux?
If I'm typing a command on the console and need to go to the start then I first press escape followed by ^ after which I'm taken straight to the start of the line.

I'm using ksh on all my servers (for my own user account) where I'm using the so called 'vi mode'. So basically the shell options vi and vi-tabcomplete are both enabled. And that allows me to use vi-styled commands. It's an option I heavily enjoy.

I can move on the commandline (apart from using ^ and $ I can also use commands such as w or W which can jump to the next or previous word, options are endless). And apart from moving on the commandline I can also use the vi movement keys to recall previously used commands. Or use the search option (by pressing /) and simply search for one. Or what to think about quickly deleting something? A quick escape followed by d and w will delete the word. Or if I want to retype the rest of the commandline I simply use d and $ which will delete everything behind the current cursor location.

The options are endless, and stuff like that makes working with the commandline a whole lot more enjoyable for me.
 
tzoi516 said:
Are these custom configurations, or are they stock?
Sorry for my late response but I wasn't quite sure what you mean with this. But considering how your message sits directly under mine I'm assuming that you meant to ask me this question.

And if not then well, maybe this is useful for someone else ;)

The 'vi-mode' is stock, it comes out of the box so to speak:

Code:
smtp2:/home/peter $ echo $0
-ksh
smtp2:/home/peter $ set -o
Current option settings
allexport      off  keyword        off  nolog          off  trackall       off
braceexpand    on   login          on   notify         off  verbose        off
bgnice         off  markdirs       off  nounset        off  vi             on
emacs          off  monitor        on   physical       off  viraw          off
errexit        off  noclobber      off  posix          on   vi-show8       off
gmacs          off  noexec         off  privileged     off  vi-tabcomplete on
ignoreeof      off  noglob         off  restricted     off  vi-esccomplete off
interactive    on   nohup          on   stdin          on   xtrace         off
But although I'm using ksh myself keep in mind that this option isn't exclusive for that shell only. Bourne and Bourne Again (or better put: sh and bash) also support this option:

Code:
smtp2:/home/peter $ sh
$ set -o | grep vi
vi              off
privileged      off
$ bash
[peter@smtp2 ~]$ set -o | grep vi
privileged      off
vi              off
[peter@smtp2 ~]$ csh
peter@smtp2:/home/peter % set -o
set: Variable name must begin with a letter.
As you can see I have no idea about the C Shell but I'm only using that for the root user anyway ;)
 
It was to you, so thanks for the assumption. :)

Thread flow, to me at least, seems hard to follow when every post has a quote. So I tend to quote when I know I won't be able to get my post in below the person I'm directing my post to.
 
tzoi516 said:
I'm using shells/pdksh. But I'm convinced that the same can be achieved by shells/ksh93 as well, I've been using this setup ever since I became a Solaris administrator, which is already quite some time ago.

Since you're interested, I'm achieving all of this on my environment by adding this to my ~/.profile:

Code:
# enable KSH settings
. $HOME/.ksh;

# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.ksh; export ENV
I'm using the ENV variable to make sure that my settings are also applied whenever I'm opening a new TMux screen.

Then my ~/.ksh profile, this contains the following:

Code:
if [ "$0" == "-ksh" ]; then
   set -o posix -o braceexpand -o vi -o vi-tabcomplete;
   PS1="`hostname -s`:\${PWD} \$ ";
fi
There was a very good reason why I'm checking for the active shell prior to setting these settings but unfortunately I can't recall them from the top of my head. Probably related to my usage of su and keeping csh as the shell for the root user.

Edit: s/CSH/csh
 
Juanitou said:
For tcsh: % echo 'bindkey -v' >> ~/.cshrc
Since we don't have a thanks system right now I'll just have to write out an "I owe you +1" and do things the hard way ;)

Cool!

Thanks for sharing this. Now, I'm not going to mess with my root environment (I tend to keep this as pristine as possible) but I'm very happy to learn about the bindkey option. I just checked tcsh(1) and this setup is indeed mentioned there as well (small quote): "but bindkey can change the key bindings to vi-style bindings en masse.".

It goes to show us once again that tcsh is not to be underestimated :h
 
tzoi516 said:
Thanks @ShelLuser.

I'm running FreeBSD 10.0-RC1 and can't make install or use ports-mgmt/portmaster; shells/ksh93 can't find the file when installing, and shells/pdksh is saying it's broken in FreeBSD 10. I haven't tried pkg install, but I'm not sure if I want to go that route just yet.
You might want to check out shells/mksh. It is a successor of shells/pdksh and in active development. I happen to use it on several smaller (some of them embedded) Linux based machines, where it's a lot faster that the default shells/bash that comes with those. :) And I sometimes consider making it my main shell, but I just haven't gotten around to that yet.
 
Last edited by a moderator:
Thanks. Even that one is giving me errors, and it's not even in my ports tree

error:
Code:
===>>> Package installation support cannot be used with pkgng yet,
       it will be disabled


	===>>> No /usr/ports/editors/mksh exists, and no information
	===>>> about editors/mksh can be found in /usr/ports/MOVED

===>>> No valid installed port, or port directory given
===>>> Try portmaster --help

===>>> Killing background jobs
Terminated
===>>> Exiting

/usr/ports/editors partial listing:
Code:
drwxr-xr-x  2 root  wheel     5 Dec  5 10:22 mg/
drwxr-xr-x  3 root  wheel     7 Dec  5 10:22 mined/
drwxr-xr-x  3 root  wheel     7 Dec  5 10:22 mlview/
drwxr-xr-x  3 root  wheel     7 Dec  5 10:22 morla/
drwxr-xr-x  3 root  wheel     7 Dec  5 10:22 mousepad/
drwxr-xr-x  3 root  wheel     7 Dec  5 10:22 mp/
drwxr-xr-x  3 root  wheel     7 Dec  5 10:22 nano/
drwxr-xr-x  3 root  wheel     7 Dec  5 10:22 nano-devel/
drwxr-xr-x  2 root  wheel     5 Dec  5 10:22 ne/
drwxr-xr-x  3 root  wheel     7 Dec  5 10:22 nedit/
 
I'll have to install games/sl on my brother's computer for a laugh. Good thing his Linux distribution of choice always runs as root :) Thanks!

I'm very far from being a vi guru of any kind, but I too really like to use vi-like tools on the terminal when I can. I've been using misc/vifm for a long time now, and have my favourite shell, shells/zsh, set up with vi mode and I've also set it up with the solarized colour scheme, and a few odd aliases like ":q".

There are also many non-vi-related zsh customisations that make using the terminal a real pleasure, such as custom prompt with git info/branches and current vi-mode, extra completions, mimeype handling and certain zsh functions sch as zmv and zargs. No need to fire up a file manager at all! :)

And here is an example of a shell function called bd that I seem to use a lot.

Regarding vi mode mentioned above, I have a question for the more skilled vi users out there (as I've been spoiled with the like of editors/vim from the start).

In my vim, backspace and delete work as they "usually" do in other programs. However, in vi and vi mode in zsh, backspace (and Ctrl+H) only work up until the last insert point, and the delete key simply changes the case of the characters (not sure how it behaves in shells/khs93, shells/pdksh, shells/bash or shells/mksh but I'm assuming it is the same).

So what's the typical vi way of backspacing past insert points or deleting characters? Is it simply "dw" / "dW" and "db" / "dB"?
 
Are there any text browsers with good JavaScript support? I have tried elinks but it has trouble with web mail and online banking. In all honesty, firefox is my primary reason for keeping X11 installed.
 
Back
Top