Conemu:如何从任务文件的一个选项卡中创建多个控制台窗口?


29

如何通过任务文件在一个选项卡中创建多个控制台窗口?我想在一个选项卡中制作2×2的控制台网格。创建新控制台并选择“向右”或“至底”选项时,我可以手动完成此操作。但我希望它在启动时自动创建。由于某些原因,选项“自动保存/恢复已打开的任务”无法使用。因此,唯一的方法是在任务中创建它。那么,如何在任务中创建2×2网格?

Answers:


44

这是您的任务内容。已在ConEmu内部版本120909中签入。

>cmd -cur_console:n
cmd -cur_console:s1TVn
cmd -cur_console:s1THn
cmd -cur_console:s2THn

这是一个例子。ConEmu中的拆分可能会像您想要的那样复杂,任何比例的任何配置都是可能的。阅读项目Wiki,以获取有关-new_console-cur_console切换的更多信息。

要运行所有这些而不创建新任务

有的/cmdlist ConEmu.exe开关。

快捷方式内容的用法示例(例如,在台式机上):

ConEmu -cmdlist cmd -cur_console:fn ||| cmd -cur_console:s1TVn ||| cmd -cur_console:s1THn ||| cmd -cur_console:s2THn

需要从另一个cmd文件运行该文件吗?这是consoles.cmd示例:

start ConEmu -cmdlist cmd -cur_console:fn ^|^|^| cmd -cur_console:s1TVn ^|^|^| cmd -cur_console:s1THn ^|^|^| cmd -cur_console:s2THn

您能告诉我如何执行此命令吗?我已经尝试过了,就是我得到的。我有最新的版本。
arin

关键字是“任务”。为什么要尝试从已启动的Shell运行此程序?设置任务。
Maximus

@Maximus我觉得这是一个shell命令。谢谢。
arin

1
@arin您也可以从shell中使用它,但是需要-new_console:...而不是-cur_console
Maximus

@Maximus:在该任务示例中如何精确配置窗口大小?例如,我要设置类似于您在Twitter上发布的内容,而不是正方形网格。您可以参考一些文档吗?
Isxek

2

我想出了以下实现。我将其用于Web开发项目。任务运行程序(例如:gulp),git,javascript编译器(例如:typescript)等的控制台。目标是打开4个控制台窗口,并将目录更改为我执行* .cmd的目录。我不想拥有批处理脚本的多个副本,以防万一我不得不更改它。我不希望该外壳是批处理的,我希望该外壳是bash的。我在Windows上,因此bash shell需要cygwin。

我创建了一个任意命名的.cmd文件。我打电话给我4 consoles.cmd。Cygwin已安装(在我的情况下为64位版本)。另外,还chere必须安装Cygwin 软件包。

4 consoles.cmd 内容:

@echo off

for %%i in ("%~dp0..\..") DO (set dirVar=%%~ni)
for %%i in ("%~dp0.") DO (set dir2Var=%%~ni)

set finalValue=%dirVar% %dir2Var%

start C:\"Program Files"\ConEmu\ConEmu64.exe -cmdlist ^
C:\cygwin64\bin\bash -c "/bin/xhere /bin/bash.exe" -cur_console:fna:t:"%finalValue%":C:"C:\cygwin64\Cygwin.ico" ^|^|^| ^
C:\cygwin64\bin\bash -c "/bin/xhere /bin/bash.exe" -cur_console:s1TVna:t:"%finalValue%":C:"C:\cygwin64\Cygwin.ico" ^|^|^| ^
C:\cygwin64\bin\bash -c "/bin/xhere /bin/bash.exe" -cur_console:s1THna:t:"%finalValue%":C:"C:\cygwin64\Cygwin.ico" ^|^|^| ^
C:\cygwin64\bin\bash -c "/bin/xhere /bin/bash.exe" -cur_console:s2THna:t:"%finalValue%":C:"C:\cygwin64\Cygwin.ico"

我把4 consoles.cmd在一个网络硬盘备份的目的柜面我的硬盘驱动器崩溃。在开发机器之间共享时也提供一些便利。

批处理脚本会将所有4个控制台窗口的目录更改为.cmd所在的目录。因此,我在希望所有4个控制台窗口都将目录更改为的目录中创建了Hard Symbolic链接。符号链接指向标准规范4 consoles.cmd

运行一个符号链接,四个控制台外壳工作目录将成为该符号链接在文件系统上的位置

我对所有感兴趣的人的任务

package.json

{
  "name": "MyApp",
  "version": "1.0.0",
  "description": "",
  "main": "gulpfile.js",
  "private": true,
  "devDependencies": {
    "del": "^1.2.0",
    "gulp": "^3.9.0",
    "gulp-batch": "^1.0.5",
    "gulp-concat": "^2.5.2",
    "gulp-imagemin": "^2.2.1",
    "gulp-minify-css": "^1.1.6",
    "gulp-ng-annotate": "^1.0.0",
    "gulp-plumber": "^1.0.1",
    "gulp-rename": "^1.2.2",
    "gulp-sourcemaps": "^1.5.2",
    "gulp-uglify": "^1.2.0",
    "gulp-watch": "^4.2.4",
    "imagemin-pngquant": "^4.1.0"
  },
  "author": "Author",
  "license": "ISC"
}

bower.json

{
  "name": "MyProject",
  "version": "1",
  "license": "MIT",
  "private": true,
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components"
  ],
  "dependencies": {
    "bootstrap": "~3.3.4",
    "jquery": "~2.1.3",
    "angular": "~1.4.0",
    "angular-route": "~1.4.0",
    "angular-animate": "~1.4.0",
    "font-awesome": "~4.3.0",
    "underscore": "~1.8.3",
    "bootstrap-datepicker": "~1.4.0",
    "angularjs-toaster": "~0.4.12",
    "angular-scroll": "~0.7.0",
    "moment": "~2.10.2",
    "angular-loading-bar": "~0.7.1"
  }
}

gulpfile.js

'use strict';

var gulp = require('gulp');
var batch = require('gulp-batch');
var sourcemaps = require('gulp-sourcemaps');
var minifycss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var del = require('del');
var plumber = require('gulp-plumber');
var watch = require('gulp-watch');
var imagemin = require('gulp-imagemin');
var pngquant = require('imagemin-pngquant');
var ngAnnotate = require('gulp-ng-annotate');

gulp.task('default', ['clean'], function () {
    gulp.start('images', 'vendorCss', 'applicationCss', 'fontIcons', 'vendorJavascript', 'applicationJavascript');
});

gulp.task('clean', function (cb) {
    del(['./dist/*'], cb);
});

gulp.task('images', function () {
    return gulp.src([
            './content/img/**/*'
    ])
        .pipe(imagemin({
            optimizationLevel: 3,
            progressive: true,
            interlaced: true,
            svgoPlugins: [{ removeViewBox: false }],
            use: [pngquant()]
        }))
        .pipe(gulp.dest('./dist/img'));
});

gulp.task('fontIcons', function () {
    return gulp.src([
        './bower_components/bootstrap/dist/fonts/**.*',
        './bower_components/font-awesome/fonts/**.*'
    ])
        .pipe(gulp.dest('./dist/fonts'));

});

gulp.task('vendorCss', function () {
    return gulp.src([
        './bower_components/bootstrap/dist/css/bootstrap.css',
        './bower_components/font-awesome/css/font-awesome.css',
        './bower_components/angularjs-toaster/toaster.css',
        './bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css',
        './bower_components/angular-loading-bar/build/loading-bar.css'
    ])
        .pipe(concat('vendor.css'))
        .pipe(gulp.dest('./dist/css'))
        .pipe(rename({ suffix: '.min' }))
        .pipe(minifycss())
        .pipe(gulp.dest('./dist/css'));
});

gulp.task('vendorJavascript', function () {
    return gulp.src([
            './bower_components/jquery/dist/jquery.js',
            './bower_components/angular/angular.js',
            './bower_components/angular-route/angular-route.js',
            './bower_components/angular-resource/angular-resource.js',
            './bower_components/angular-animate/angular-animate.js',
            './bower_components/angular-scroll/angular-scroll.js',
            './bower_components/angular-loading-bar/build/loading-bar.js',
            './bower_components/angularjs-toaster/toaster.js',
            './bower_components/bootstrap/dist/js/bootstrap.js',
            './bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.js',
            './bower_components/underscore/underscore.js',
            './bower_components/moment/moment.js'
    ])
        .pipe(sourcemaps.init())
        .pipe(concat('vendor.js'))
        .pipe(gulp.dest('./dist/script'))
        .pipe(uglify())
        .pipe(rename('vendor.min.js'))
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('./dist/script'));
});

gulp.task('applicationCss', function () {
    return gulp.src([
            './content/css/site.css',
            './content/css/animation.css'
    ])
        .pipe(plumber())
        .pipe(concat('app.css'))
        .pipe(gulp.dest('./dist/css'))
        .pipe(rename({ suffix: '.min' }))
        .pipe(minifycss())
        .pipe(gulp.dest('./dist/css'));
});

gulp.task('applicationJavascript', function () {
    return gulp.src([
            './angular/**/*.js'
    ])
        .pipe(plumber())
        .pipe(ngAnnotate())
        .pipe(sourcemaps.init())
        .pipe(concat('app.js'))
        .pipe(gulp.dest('./dist/script'))
        .pipe(uglify())
        .pipe(rename('app.min.js'))
        .pipe(sourcemaps.write('.'))
        .pipe(gulp.dest('./dist/script'));

});

gulp.task('watchApplicationJavascript', ['applicationJavascript'], function () {
    watch('./angular/**/*.js', batch(function (events, done) {
        gulp.start('applicationJavascript', done);
    }));
});

gulp.task('watchApplicationCss', ['applicationCss'], function () {
    watch(['./content/css/site.css', './content/css/animation.css'], batch(function (events, done) {
        gulp.start('applicationCss', done);
    }));
});
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.