ruby-shell 0.19 → 0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rshrc +9 -4
- data/README.md +6 -2
- data/bin/rsh +6 -3
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b228176dfbc09b05c908d44bd1121aa7bd9c0c18c6cbf06c09a74bc9c4e492bb
|
4
|
+
data.tar.gz: 8ff9a56792681fcc704ec6de601255a43c4b5e23a88b100f121d5e2c33c9aa7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c6b7100c0eda1aa62a1f74839d5c6bbaa80f99f788ed106f3f98c7b0e7ee8ee705dcfe69cb692ebd0f275e264324cec53bc2874e4e638b705c6b9a49277a6fc
|
7
|
+
data.tar.gz: 9d01e0a80972585cef90ed9e90f865f13aebb03e04502084a4a9f65500430ca548e19b3a5eb8c9dbfd594bcefe836bb33aea110f7ace4e20b6253ca270621fff
|
data/.rshrc
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# vim: set ft=ruby sw=2 sts=2 et :
|
2
2
|
|
3
|
+
# ENVIRONMENT
|
4
|
+
#@lscolors = "/home/geir/.local/share/lscolors.sh"
|
5
|
+
ENV["EDITOR"] = "vim"
|
6
|
+
ENV["MANPAGER"] = "vim +MANPAGER -"
|
7
|
+
|
3
8
|
# PROMPT
|
4
|
-
# The numbers in parenthesis are 256 color codes (the '.c()' is a String extention
|
5
|
-
# to color text in the terminal. Add '.b' for bold and '.i' for italics.
|
6
9
|
if @user == "root"
|
7
|
-
@prompt = "#{@user}@#{@node}".c(160) + ":".c(255) + " #{Dir.pwd}/".c(196) + " ".c(7)
|
10
|
+
@prompt = "#{@user}@#{@node}".c(160).b + ":".c(255) + " #{Dir.pwd}/".c(196) + " ".c(7)
|
8
11
|
else
|
9
12
|
@prompt = "#{@user}@#{@node}".c(46) + ":".c(255) + " #{Dir.pwd}/".c(196) + " ".c(7)
|
10
13
|
end
|
@@ -20,5 +23,7 @@ end
|
|
20
23
|
@c_taboption = 244 # Color for unselected tabcompleted item
|
21
24
|
@c_stamp = 244 # Color for time stamp/command
|
22
25
|
|
23
|
-
#
|
26
|
+
# NICKS AND HISTORY
|
24
27
|
@nick = {"ls"=>"ls --color -F"}
|
28
|
+
@gnick = {}
|
29
|
+
@history = []
|
data/README.md
CHANGED
@@ -89,10 +89,14 @@ Variable | Description
|
|
89
89
|
## The .rshrc
|
90
90
|
`.rshrc` is the configuration file for rsh and it is located in your home directory. It is created when you first start rsh and you can modify it to suit your needs. A more detailed .rshrc is found in the the [rsh github repo](https://github.com/isene/rsh) - you can drop this into your home dir if you like. Set the basic environment variables like this:
|
91
91
|
```
|
92
|
-
|
92
|
+
ENV["EDITOR"] = "vim"
|
93
|
+
ENV["MANPAGER"] = "vim +MANPAGER -"
|
94
|
+
```
|
95
|
+
Also, a special variable for better LS_COLOR setup:
|
96
|
+
```
|
93
97
|
@lscolors = "/home/geir/.local/share/lscolors.sh"
|
94
98
|
```
|
95
|
-
|
99
|
+
Point `@lscolors` to a file that sets your LS_COLORS variable. Use [my extended LS_COLORS setup](https://github.com/isene/LS_COLORS) to make this really fancy.
|
96
100
|
|
97
101
|
You can add any Ruby code to your .rshrc.
|
98
102
|
|
data/bin/rsh
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
# for any damages resulting from its use. Further, I am under no
|
15
15
|
# obligation to maintain or extend this software. It is provided
|
16
16
|
# on an 'as is' basis without any expressed or implied warranty.
|
17
|
-
@version = "0.
|
17
|
+
@version = "0.20"
|
18
18
|
|
19
19
|
# MODULES, CLASSES AND EXTENSIONS
|
20
20
|
class String # Add coloring to strings (with escaping for Readline)
|
@@ -599,7 +599,10 @@ begin # Load .rshrc and populate @history
|
|
599
599
|
trap "SIGINT" do print "\n"; exit end
|
600
600
|
firstrun unless File.exist?(Dir.home+'/.rshrc') # Initial loading - to get history
|
601
601
|
load(Dir.home+'/.rshrc')
|
602
|
-
ENV["
|
602
|
+
ENV["SHELL"] = __FILE__
|
603
|
+
ENV["TERM"] = "rxvt-unicode-256color"
|
604
|
+
ENV["PATH"] ? ENV["PATH"] += ":" : ENV["PATH"] = ""
|
605
|
+
ENV["PATH"] += "/home/#{@user}/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
603
606
|
if File.exist?(@lscolors)
|
604
607
|
ls = File.read(@lscolors)
|
605
608
|
ls.sub!(/export.*/, '')
|
@@ -676,7 +679,7 @@ loop do
|
|
676
679
|
res = `fzf`.chomp
|
677
680
|
Dir.chdir(File.dirname(res))
|
678
681
|
else
|
679
|
-
if File.exist?(@cmd)
|
682
|
+
if File.exist?(@cmd) and not File.executable?(@cmd)
|
680
683
|
if File.read(@cmd).force_encoding("UTF-8").valid_encoding?
|
681
684
|
system("#{ENV['EDITOR']} #{@cmd}") # Try open with user's editor
|
682
685
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.20'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
@@ -12,8 +12,7 @@ date: 2023-06-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
13
13
|
description: 'A shell written in Ruby with extensive tab completions, aliases/nicks,
|
14
14
|
history, syntax highlighting, theming and more. In continual development. New in
|
15
|
-
0.
|
16
|
-
tab completions for command switches/options.'
|
15
|
+
0.20: Changes needed to make rsh a proper login shell.'
|
17
16
|
email: g@isene.com
|
18
17
|
executables:
|
19
18
|
- rsh
|