mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-12-28 15:14:51 +08:00
Clean up TerminalSession constructor a bit
This commit is contained in:
parent
51e8755634
commit
98f926d53d
|
@ -3,8 +3,17 @@ require 'securerandom'
|
|||
class TerminalSession
|
||||
ZSH_BIN = ENV['TEST_ZSH_BIN'] || 'zsh'
|
||||
|
||||
def initialize(width: 80, height: 24, prompt: '', term: 'xterm-256color')
|
||||
tmux_command("new-session -d -x #{width} -y #{height} 'PS1=#{prompt} TERM=#{term} #{ZSH_BIN} -f'")
|
||||
def initialize(opts = {})
|
||||
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
|
||||
|
||||
def run_command(command)
|
||||
|
|
Loading…
Reference in New Issue
Block a user