mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Clean up TerminalSession constructor a bit
This commit is contained in:
parent
51e8755634
commit
98f926d53d
1 changed files with 11 additions and 2 deletions
|
@ -3,8 +3,17 @@ require 'securerandom'
|
||||||
class TerminalSession
|
class TerminalSession
|
||||||
ZSH_BIN = ENV['TEST_ZSH_BIN'] || 'zsh'
|
ZSH_BIN = ENV['TEST_ZSH_BIN'] || 'zsh'
|
||||||
|
|
||||||
def initialize(width: 80, height: 24, prompt: '', term: 'xterm-256color')
|
def initialize(opts = {})
|
||||||
tmux_command("new-session -d -x #{width} -y #{height} 'PS1=#{prompt} TERM=#{term} #{ZSH_BIN} -f'")
|
opts = {
|
||||||
|
width: 80,
|
||||||
|
height: 24,
|
||||||
|
prompt: '',
|
||||||
|
term: 'xterm-256color',
|
||||||
|
zsh_bin: ZSH_BIN
|
||||||
|
}.merge(opts)
|
||||||
|
|
||||||
|
cmd="PS1=#{opts[:prompt]} TERM=#{opts[:term]} #{ZSH_BIN} -f"
|
||||||
|
tmux_command("new-session -d -x #{opts[:width]} -y #{opts[:height]} '#{cmd}'")
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_command(command)
|
def run_command(command)
|
||||||
|
|
Loading…
Reference in a new issue